Skip to contentSkip to conversation

net: correctly interlink lower/upper devices

PATCH Applied Veaceslav Falico 2 participants 2 messages Sep 2, 2013 – Sep 4, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: correctly interlink lower/upper devices

Currently we're linking upper devices to lower ones, which results in upside-down relationship: upper devices seeing lower devices via its upper lists.

Fix this by correctly linking lower devices to the upper ones.

CC "David S. Miller" <[email protected]>
CC Eric Dumazet <[email protected]>
CC Jiri Pirko <[email protected]>
CC Alexander Duyck <[email protected]>
CC Cong Wang <[email protected]>
---
 net/core/dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/dev.c +2 -2
index 6fbb0c9..743620e 100644
@@ -4679,8 +4679,8 @@ static int __netdev_upper_dev_link(struct net_device *dev,
 	 * versa, and don't forget the devices itself. All of these
 	 * links are non-neighbours.
 	 */
-	list_for_each_entry(i, &upper_dev->upper_dev_list, list) {
-		list_for_each_entry(j, &dev->lower_dev_list, list) {
+	list_for_each_entry(i, &dev->lower_dev_list, list) {
+		list_for_each_entry(j, &upper_dev->upper_dev_list, list) {
 			ret = __netdev_adjacent_dev_link(i->dev, j->dev);
 			if (ret)
 				goto rollback_mesh;
Signature · 1 line
1.8.4
maintainer Applied
#1 lore raw

From: Veaceslav Falico <[email protected]>
Date: Mon, 2 Sep 2013 16:26:51 +0200

Quoted 7 lines

Currently we're linking upper devices to lower ones, which results in upside-down relationship: upper devices seeing lower devices via its upper lists.

Fix this by correctly linking lower devices to the upper ones.

Applied.