All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Noam <amir.noam@intel.com>
To: Jay Vosburgh <fubar@us.ibm.com>, jgarzik@pobox.com
Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com
Subject: [PATCH 1/3][bonding 2.6] Cannot remove and re-enslave the original active slave
Date: Thu, 25 Dec 2003 17:05:13 +0200	[thread overview]
Message-ID: <200312251705.14755.amir.noam@intel.com> (raw)

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 15:31:02 2003
+++ b/drivers/net/bonding/bond_alb.c	Thu Dec 25 15:31:03 2003
@@ -992,6 +992,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) {
@@ -1049,6 +1050,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) {
@@ -1059,7 +1069,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 "

             reply	other threads:[~2003-12-25 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-25 15:05 Amir Noam [this message]
2003-12-30  4:52 ` [PATCH 1/3][bonding 2.6] Cannot remove and re-enslave the original active slave Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200312251705.14755.amir.noam@intel.com \
    --to=amir.noam@intel.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=fubar@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.