提交 c3262d9d 编写于 作者: M Mahesh Bandewar 提交者: David S. Miller

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: NMahesh Bandewar <maheshb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1b7cd004
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册