aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipvlan/ipvlan_main.c
diff options
context:
space:
mode:
authorMahesh Bandewar <[email protected]>2017-01-18 23:02:53 +0000
committerDavid S. Miller <[email protected]>2017-01-20 17:22:26 +0000
commitc3262d9deccaa7e796b0145b2d26f53c0e2d178f (patch)
tree460a2e4d017b41c865228906957af9a2f5f86291 /drivers/net/ipvlan/ipvlan_main.c
parentnet: remove duplicate code. (diff)
downloadkernel-c3262d9deccaa7e796b0145b2d26f53c0e2d178f.tar.gz
kernel-c3262d9deccaa7e796b0145b2d26f53c0e2d178f.zip
ipvlan: use netdev_is_rx_handler_busy instead of checking specific type
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_main.c')
-rw-r--r--drivers/net/ipvlan/ipvlan_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index b5c390f0f2b3..95b18f4602cf 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -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;
}