diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-04-02 11:07:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-02 14:05:01 -0400 |
commit | e1622baf54df8cc958bf29d71de5ad545ea7d93c (patch) | |
tree | 4a019a2a3e79c4fc9706b91cbb55d2cd053065d4 /net/core/dev.c | |
parent | 7a66bbc96ce9ad8261fa5f7f6ae65370eb6866ee (diff) |
dev: set iflink to 0 for virtual interfaces
Virtual interfaces are supposed to set an iflink value != of their ifindex.
It was not the case for some of them, like vxlan, bond or bridge.
Let's set iflink to 0 when dev->rtnl_link_ops is set.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 3be107e0bc93..26622d614f81 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -672,6 +672,10 @@ int dev_get_iflink(const struct net_device *dev) | |||
672 | if (dev->netdev_ops && dev->netdev_ops->ndo_get_iflink) | 672 | if (dev->netdev_ops && dev->netdev_ops->ndo_get_iflink) |
673 | return dev->netdev_ops->ndo_get_iflink(dev); | 673 | return dev->netdev_ops->ndo_get_iflink(dev); |
674 | 674 | ||
675 | /* If dev->rtnl_link_ops is set, it's a virtual interface. */ | ||
676 | if (dev->rtnl_link_ops) | ||
677 | return 0; | ||
678 | |||
675 | return dev->ifindex; | 679 | return dev->ifindex; |
676 | } | 680 | } |
677 | EXPORT_SYMBOL(dev_get_iflink); | 681 | EXPORT_SYMBOL(dev_get_iflink); |