提交 2640b39c 编写于 作者: N Nikolay Aleksandrov 提交者: David S. Miller

vrf: ndo_add|del_slave drop unnecessary checks

When ndo_add|del_slave ops are used, they're taken from the respective
master device's netdev ops, so if the master device is a VRF only then
the VRF ops will get called thus no need to check the type of the
master.
Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 15df5e71
......@@ -393,8 +393,7 @@ static int do_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)
{
if (!netif_is_vrf(dev) || netif_is_vrf(port_dev) ||
vrf_is_slave(port_dev))
if (netif_is_vrf(port_dev) || vrf_is_slave(port_dev))
return -EINVAL;
return do_vrf_add_slave(dev, port_dev);
......@@ -431,9 +430,6 @@ static int do_vrf_del_slave(struct net_device *dev, struct net_device *port_dev)
static int vrf_del_slave(struct net_device *dev, struct net_device *port_dev)
{
if (!netif_is_vrf(dev))
return -EINVAL;
return do_vrf_del_slave(dev, port_dev);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册