29 lines
904 B
Diff
29 lines
904 B
Diff
From 1d992600b0f1962d0478df2083b76b1ceba50517 Mon Sep 17 00:00:00 2001
|
|
From: Tom Goff <thomas.goff@boeing.com>
|
|
Date: Mon, 3 Jun 2013 18:29:42 -0700
|
|
Subject: [PATCH 1/3] Make network device ifindex sequential per network
|
|
namespace.
|
|
|
|
Signed-off-by: Tom Goff <thomas.goff@boeing.com>
|
|
---
|
|
net/core/dev.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/net/core/dev.c b/net/core/dev.c
|
|
index d592214..4b8da6e 100644
|
|
--- a/net/core/dev.c
|
|
+++ b/net/core/dev.c
|
|
@@ -6455,8 +6455,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
|
|
/* Actually switch the network namespace */
|
|
dev_net_set(dev, net);
|
|
|
|
- /* If there is an ifindex conflict assign a new one */
|
|
- if (__dev_get_by_index(net, dev->ifindex)) {
|
|
+ /* Assign a new ifindex */
|
|
+ {
|
|
int iflink = (dev->iflink == dev->ifindex);
|
|
dev->ifindex = dev_new_index(net);
|
|
if (iflink)
|
|
--
|
|
1.8.1.2
|
|
|