[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150220222042.GA15595@p183.telecom.by>
Date: Sat, 21 Feb 2015 01:20:42 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: davem@...emloft.net
Cc: j.vosburgh@...il.com, vfalico@...il.com, andy@...yhouse.net,
netdev@...r.kernel.org
Subject: [PATCH] bonding: ban stacked bonding support
Does Linux support it at all?
In short: if you add bonding master as a slave, and then release it,
it will no longer be a IFF_BONDING creating problems like described at
https://bugzilla.kernel.org/show_bug.cgi?id=89541
echo +bond1 >/sys/class/net/bonding_masters
echo 1 >/sys/class/net/bond1/bonding/mode
echo +bond2 >/sys/class/net/bonding_masters
echo +bond2 >/sys/class/net/bond1/bonding/slaves
echo -bond2 >/sys/class/net/bond1/bonding/slaves
echo -bond2 >/sys/class/net/bonding_masters
cat /proc/net/bonding/bond2 # should not exist
[oops]
Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
drivers/net/bonding/bond_main.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1248,6 +1248,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
slave_dev->name);
}
+ if (slave_dev->flags & IFF_MASTER) {
+ netdev_dbg(bond_dev, "stacked bonding not supported\n");
+ return -EBUSY;
+ }
+
/* already enslaved */
if (slave_dev->flags & IFF_SLAVE) {
netdev_dbg(bond_dev, "Error: Device was already enslaved\n");
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists