Subject: [PATCH] netdev: don't always reset iflink when registering

From: Tom Goff <[email-masked]>
Date: Fri, 19 Mar 2010 18:39:17 -0700

Bound tunnel devices set their iflink to the ifindex of the underlying
network interface when created.  It shouldn't be reset by the
registration process.

Signed-off-by: Tom Goff <[email-masked]>
---
 net/core/dev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 59d4394..c00d625 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5067,7 +5067,8 @@ int register_netdevice(struct net_device *dev)
 	netdev_set_addr_lockdep_class(dev);
 	netdev_init_queue_locks(dev);
 
-	dev->iflink = -1;
+	if (dev->iflink <= 0)
+		dev->iflink = -1;
 
 	/* Init, if this function is available */
 	if (dev->netdev_ops->ndo_init) {
-- 
1.6.3.3