mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-07 15:15:29 +00:00
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>
This commit is contained in:
parent
7a66bbc96c
commit
e1622baf54
1 changed files with 4 additions and 0 deletions
|
@ -672,6 +672,10 @@ int dev_get_iflink(const struct net_device *dev)
|
||||||
if (dev->netdev_ops && dev->netdev_ops->ndo_get_iflink)
|
if (dev->netdev_ops && dev->netdev_ops->ndo_get_iflink)
|
||||||
return dev->netdev_ops->ndo_get_iflink(dev);
|
return dev->netdev_ops->ndo_get_iflink(dev);
|
||||||
|
|
||||||
|
/* If dev->rtnl_link_ops is set, it's a virtual interface. */
|
||||||
|
if (dev->rtnl_link_ops)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return dev->ifindex;
|
return dev->ifindex;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dev_get_iflink);
|
EXPORT_SYMBOL(dev_get_iflink);
|
||||||
|
|
Loading…
Add table
Reference in a new issue