Skip to contentSkip to conversation

Cannot remove and re-enslave the original active slave

PATCH Applied Amir Noam 2 participants 2 messages Dec 25, 2003 – Dec 30, 2003

Subsystems (3)
lore
Share & tools
lore

Amir Noam

author
#0 lore raw

PATCH 1/3 Cannot remove and re-enslave the original active slave

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.

drivers/net/bonding/bond_alb.c +12 -1
diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
@@ -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 "
#1 lore raw

patches 1-3 applied to 2.4.x

We should be in sync now.