]> err.no Git - linux-2.6/commitdiff
[PATCH] bonding: ALB -- allow slave to use bond's MAC address if its own MAC address...
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 28 Jul 2005 19:00:15 +0000 (15:00 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Sun, 31 Jul 2005 04:37:29 +0000 (00:37 -0400)
In ALB mode, allow new slave to use bond's MAC address if the new
slave's MAC address is being used within the bond and no other slave
is using the bond's MAC address.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/bonding/bond_alb.c

index 5ce606d9dc03f9b145c3024abecfca20ec65fd9d..19e829b567d0e7735908b5562e8e0a9214803896 100644 (file)
@@ -1106,18 +1106,13 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
                        }
                }
 
-               if (found) {
-                       /* a slave was found that is using the mac address
-                        * of the new slave
-                        */
-                       printk(KERN_ERR DRV_NAME
-                              ": Error: the hw address of slave %s is not "
-                              "unique - cannot enslave it!",
-                              slave->dev->name);
-                       return -EINVAL;
-               }
+               if (!found)
+                       return 0;
 
-               return 0;
+               /* Try setting slave mac to bond address and fall-through
+                  to code handling that situation below... */
+               alb_set_slave_mac_addr(slave, bond->dev->dev_addr,
+                                      bond->alb_info.rlb_enabled);
        }
 
        /* The slave's address is equal to the address of the bond.