summaryrefslogtreecommitdiff
path: root/drivers/net/vrf.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2015-08-18 20:28:04 +0300
committerDavid S. Miller <davem@davemloft.net>2015-08-18 20:16:52 -0700
commit58aa90875da1ab075d712585305d1e520812bbb1 (patch)
treea7bb3d703f97f3c622fc25235cbac2341210d0cd /drivers/net/vrf.c
parent3a4a27d3bde1c9cd8159c86a79796348cab90140 (diff)
vrf: simplify the netdev notifier function
We can drop the check because if vrf_ptr is present then we must have the vrf device as a master and since we're running with rtnl it can't go away. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r--drivers/net/vrf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 97605eab14ae..ed208317cbb5 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -624,9 +624,8 @@ static int vrf_device_event(struct notifier_block *unused,
if (!vrf_ptr || netif_is_vrf(dev))
goto out;
- vrf_dev = __dev_get_by_index(dev_net(dev), vrf_ptr->ifindex);
- if (vrf_dev)
- vrf_del_slave(vrf_dev, dev);
+ vrf_dev = netdev_master_upper_dev_get(dev);
+ vrf_del_slave(vrf_dev, dev);
}
out:
return NOTIFY_DONE;