[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150320174638.GA2053@p183.telecom.by>
Date: Fri, 20 Mar 2015 20:46:38 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: davem@...emloft.net
Cc: vfalico@...il.com, andy@...yhouse.net, netdev@...r.kernel.org,
jay.vosburgh@...onical.com
Subject: [PATCH v2] bonding: ban stacked bonding support
If you add bonding master as a slave, and then release it,
it will no longer be an 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 (netif_is_bond_master(slave_dev)) {
+ netdev_err(bond_dev, "device is bond master\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