提交 09a89c21 编写于 作者: J Jiri Bohac 提交者: David S. Miller

bonding: disallow enslaving a bond to itself

Enslaving a bond to itself leads to an endless loop and hangs the kernel.
Signed-off-by: NJiri Bohac <jbohac@suse.cz>
Tested-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ee6154e1
......@@ -1197,6 +1197,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
return -EBUSY;
}
if (bond_dev == slave_dev) {
pr_err("%s: cannot enslave bond to itself.\n", bond_dev->name);
return -EPERM;
}
/* vlan challenged mutual exclusion */
/* no need to lock since we're protected by rtnl_lock */
if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册