summaryrefslogtreecommitdiffstats
path: root/drivers/net/vrf.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-03-16 04:08:15 -0400
committerDavid S. Miller <davem@davemloft.net>2017-03-16 13:18:34 -0400
commitfdeea7be88b12742bfd50d9e19a06c0d2e702400 (patch)
tree42c512bb85da73be4c3634c49e1a6bcbb42eb1b4 /drivers/net/vrf.c
parent5d7bfd141924a5ece21eb612ad3c56612f041c1e (diff)
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: Ido Schimmel <idosch@mellanox.com> Acked-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r--drivers/net/vrf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index fea687f35b5a..7f28021d9d93 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -747,14 +747,18 @@ static int do_vrf_add_slave(struct net_device *dev, struct net_device *port_dev)
747{ 747{
748 int ret; 748 int ret;
749 749
750 port_dev->priv_flags |= IFF_L3MDEV_SLAVE;
750 ret = netdev_master_upper_dev_link(port_dev, dev, NULL, NULL); 751 ret = netdev_master_upper_dev_link(port_dev, dev, NULL, NULL);
751 if (ret < 0) 752 if (ret < 0)
752 return ret; 753 goto err;
753 754
754 port_dev->priv_flags |= IFF_L3MDEV_SLAVE;
755 cycle_netdev(port_dev); 755 cycle_netdev(port_dev);
756 756
757 return 0; 757 return 0;
758
759err:
760 port_dev->priv_flags &= ~IFF_L3MDEV_SLAVE;
761 return ret;
758} 762}
759 763
760static int vrf_add_slave(struct net_device *dev, struct net_device *port_dev) 764static int vrf_add_slave(struct net_device *dev, struct net_device *port_dev)