提交 fdeea7be 编写于 作者: I Ido Schimmel 提交者: David S. Miller

net: vrf: Set slave's private flag before linking

Allow listeners of the subsequent CHANGEUPPER notification to retrieve
the VRF's table ID by calling l3mdev_fib_table() with the slave netdev.
Without this change, the netdev won't be considered an L3 slave and the
function would return 0.

This is consistent with other master device such as bridge and bond that
set the slave's private flag before linking. It also makes
do_vrf_{add,del}_slave() symmetric.
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5d7bfd14
...@@ -747,14 +747,18 @@ static int do_vrf_add_slave(struct net_device *dev, struct net_device *port_dev) ...@@ -747,14 +747,18 @@ static int do_vrf_add_slave(struct net_device *dev, struct net_device *port_dev)
{ {
int ret; int ret;
port_dev->priv_flags |= IFF_L3MDEV_SLAVE;
ret = netdev_master_upper_dev_link(port_dev, dev, NULL, NULL); ret = netdev_master_upper_dev_link(port_dev, dev, NULL, NULL);
if (ret < 0) if (ret < 0)
return ret; goto err;
port_dev->priv_flags |= IFF_L3MDEV_SLAVE;
cycle_netdev(port_dev); cycle_netdev(port_dev);
return 0; return 0;
err:
port_dev->priv_flags &= ~IFF_L3MDEV_SLAVE;
return ret;
} }
static int vrf_add_slave(struct net_device *dev, struct net_device *port_dev) static int vrf_add_slave(struct net_device *dev, struct net_device *port_dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册