aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeaceslav Falico <[email protected]>2013-09-02 16:26:51 +0200
committerDavid S. Miller <[email protected]>2013-09-04 00:27:26 -0400
commit82476b316084e6826a9dd339d1dad892a598af9a (patch)
tree7aa33e21ae567be231c016334db1b146e75a776b
parentea23192e8e577dfc51e0f4fc5ca113af334edff9 (diff)
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]> Signed-off-by: Veaceslav Falico <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--net/core/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 07684e880a5d..5c713f2239cc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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;