Skip to content

Commit

Permalink
vrf: ndo_add|del_slave drop unnecessary checks
Browse files Browse the repository at this point in the history
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: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Aug 20, 2015
1 parent 15df5e7 commit 2640b39
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/net/vrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 2640b39

Please sign in to comment.