netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3][bonding 2.4] Cannot remove and re-enslave the original active slave
@ 2003-12-25 15:03 Amir Noam
  2003-12-30 15:41 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Noam @ 2003-12-25 15:03 UTC (permalink / raw)
  To: Jay Vosburgh, jgarzik; +Cc: bonding-devel, netdev

In TLB/ALB modes, when enslaving a slave that has the bond's mac
address, allow the operation if no other slave has that address.

Should be applied after the cleanup patch set.


diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
--- a/drivers/net/bonding/bond_alb.c	Thu Dec 25 16:09:29 2003
+++ b/drivers/net/bonding/bond_alb.c	Thu Dec 25 16:09:30 2003
@@ -993,6 +993,7 @@ static void alb_change_hw_addr_on_detach
 static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave)
 {
 	struct slave *tmp_slave1, *tmp_slave2, *free_mac_slave;
+	struct slave *has_bond_addr = bond->curr_active_slave;
 	int i, j, found = 0;
 
 	if (bond->slave_cnt == 0) {
@@ -1050,6 +1051,15 @@ static int alb_handle_addr_collision_on_
 			free_mac_slave = tmp_slave1;
 			break;
 		}
+
+		if (!has_bond_addr) {
+			if (!memcmp(tmp_slave1->dev->dev_addr,
+				    bond->dev->dev_addr,
+				    ETH_ALEN)) {
+
+				has_bond_addr = tmp_slave1;
+			}
+		}
 	}
 
 	if (free_mac_slave) {
@@ -1060,7 +1070,8 @@ static int alb_handle_addr_collision_on_
 		       ": Warning: the hw address of slave %s is in use by "
 		       "the bond; giving it the hw address of %s\n",
 		       slave->dev->name, free_mac_slave->dev->name);
-	} else {
+
+	} else if (has_bond_addr) {
 		printk(KERN_ERR DRV_NAME
 		       ": Error: the hw address of slave %s is in use by the "
 		       "bond; couldn't find a slave with a free hw address to "

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-30 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-25 15:03 [PATCH 1/3][bonding 2.4] Cannot remove and re-enslave the original active slave Amir Noam
2003-12-30 15:41 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).