projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee6154e
)
bonding: disallow enslaving a bond to itself
author
Jiri Bohac
<
[email protected]
>
Wed, 26 Feb 2014 17:20:13 +0000
(18:20 +0100)
committer
David S. Miller
<
[email protected]
>
Thu, 27 Feb 2014 03:37:12 +0000
(22:37 -0500)
Enslaving a bond to itself leads to an endless loop and hangs the kernel.
Signed-off-by: Jiri Bohac <
[email protected]
>
Tested-by: Ding Tianhong <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/bonding/bond_main.c
patch
|
blob
|
history
diff --git
a/drivers/net/bonding/bond_main.c
b/drivers/net/bonding/bond_main.c
index b47fa0421e01e63231fd659c02ed04ffbd89ca52..e5628fc725c3fc3885b7deac79074caa41edbae4 100644
(file)
--- a/
drivers/net/bonding/bond_main.c
+++ b/
drivers/net/bonding/bond_main.c
@@
-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) {