Commit 58aa9087 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

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: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3a4a27d3
...@@ -624,8 +624,7 @@ static int vrf_device_event(struct notifier_block *unused, ...@@ -624,8 +624,7 @@ static int vrf_device_event(struct notifier_block *unused,
if (!vrf_ptr || netif_is_vrf(dev)) if (!vrf_ptr || netif_is_vrf(dev))
goto out; goto out;
vrf_dev = __dev_get_by_index(dev_net(dev), vrf_ptr->ifindex); vrf_dev = netdev_master_upper_dev_get(dev);
if (vrf_dev)
vrf_del_slave(vrf_dev, dev); vrf_del_slave(vrf_dev, dev);
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment