提交 58aa9087 编写于 作者: N Nikolay Aleksandrov 提交者: 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: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3a4a27d3
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册