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

ipvlan: play well with macvlan device

If a device is already a macvlan port then refuse to use it as
an ipvlan port in the early stage of port creation.

	thost1:~# ip link add link eth0 mvl0 type macvlan
	thost1:~# echo $?
	0
	thost1:~# ip link add link eth0 ipvl0 type ipvlan
	RTNETLINK answers: Device or resource busy
	thost1:~# echo $?
	2
	thost1:~#
Signed-off-by: NMahesh Bandewar <maheshb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2f33e7d5
......@@ -38,6 +38,12 @@ static int ipvlan_port_create(struct net_device *dev)
netdev_err(dev, "Master is either lo or non-ether device\n");
return -EINVAL;
}
if (netif_is_macvlan_port(dev)) {
netdev_err(dev, "Master is a macvlan port.\n");
return -EBUSY;
}
port = kzalloc(sizeof(struct ipvl_port), GFP_KERNEL);
if (!port)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册