Thread (1 message) 1 message, 1 author, 2011-01-19

Re: [Bonding-devel] Bonding on bond

From: Jiri Bohac <hidden>
Date: 2011-01-19 15:49:52
Subsystem: bonding driver, networking drivers, the rest · Maintainers: Jay Vosburgh, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

On Tue, Jan 18, 2011 at 09:07:20AM +0100, Nicolas de Pesloüan wrote:
Staking bond is not supported. Currently, no setup is know to
require stacking bond.
I agree. This question and weird bugreports from people trying
this come up over and over. How about this patch?


bonding: prohibit enslaving of bonding masters

Nested bonding is not supported and will result in strange problems, e.g.:
- netif_receive_skb() will not properly change skb->dev to point to the
  uppoer-most bonding master
- arp monitor will not work (dev->last_rx is only updated by hardware drivers)
- accidentally enslaving a bonding master to itself will cause an infinite
  recursion in the TX path

This patch prevents this by prohibiting a bonding master from being further enslaved.

Signed-off-by: Jiri Bohac <redacted>
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b1025b8..d4d5f42 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1448,8 +1448,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 	}
 
 	/* already enslaved */
-	if (slave_dev->flags & IFF_SLAVE) {
-		pr_debug("Error, Device was already enslaved\n");
+	if (slave_dev->priv_flags & IFF_BONDING) {
+		pr_debug("Error, Device already enslaved or a bonding master\n");
 		return -EBUSY;
 	}
 
-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help