Skip to content

Commit

Permalink
ipvlan: use netdev_is_rx_handler_busy instead of checking specific type
Browse files Browse the repository at this point in the history
IPvlan checks if the master device is already used by checking a
specific device (here it's macvlan device). This is technically not
sufficient and it should just ensure the rx_handler is busy or not.
This would be a super check that includes macvlan and any other that
has already registered rx-handler.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mahesh Bandewar authored and David S. Miller committed Jan 20, 2017
1 parent 1b7cd00 commit c3262d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ipvlan/ipvlan_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ static int ipvlan_port_create(struct net_device *dev)
return -EINVAL;
}

if (netif_is_macvlan_port(dev)) {
netdev_err(dev, "Master is a macvlan port.\n");
if (netdev_is_rx_handler_busy(dev)) {
netdev_err(dev, "Device is already in use.\n");
return -EBUSY;
}

Expand Down

0 comments on commit c3262d9

Please sign in to comment.