diff mbox

bonding: rlb mode of bond should not alter ARP replies originating via bridge

Message ID 1352258580-8272-1-git-send-email-zheng.x.li@oracle.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

zheng.li Nov. 7, 2012, 3:23 a.m. UTC
ARP traffic passing through a bridge and out via the bond (when the bond is a 
port of the bridge) should not have its source MAC address adjusted by the 
receive load balance code in rlb_arp_xmit.

Signed-off-by: Zheng Li <zheng.x.li@oracle.com>
Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: "David S. Miller" <davem@davemloft.net>

---
 drivers/net/bonding/bond_alb.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

Comments

David Miller Nov. 9, 2012, 9:25 p.m. UTC | #1
From: Zheng Li <zheng.x.li@oracle.com>
Date: Wed,  7 Nov 2012 11:23:00 +0800

> ARP traffic passing through a bridge and out via the bond (when the bond is a 
> port of the bridge) should not have its source MAC address adjusted by the 
> receive load balance code in rlb_arp_xmit.
> 
> Signed-off-by: Zheng Li <zheng.x.li@oracle.com>

Please format these change properly, this is not indented
correctly at all:

> +				if (ether_addr_equal_64bits(arp->mac_src,
> +						tmp_slave->dev->dev_addr)) {
> +					memcpy(arp->mac_src,
> +						tx_slave->dev->dev_addr,
> +						ETH_ALEN);
> +					break;

Arguments to functions should line up, always, with the first column
after the openning parenthesis of the function call.

If that makes the far right column of the line go too far past
80 columns, too bad.  Make and use a helper function to perform
this test in that case.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index e15cc11..641b3f1 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -700,7 +700,17 @@  static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
 		*/
 		tx_slave = rlb_choose_channel(skb, bond);
 		if (tx_slave) {
-			memcpy(arp->mac_src,tx_slave->dev->dev_addr, ETH_ALEN);
+			struct slave *tmp_slave = NULL;
+			int i = 0;
+			bond_for_each_slave(bond, tmp_slave, i) {
+				if (ether_addr_equal_64bits(arp->mac_src,
+						tmp_slave->dev->dev_addr)) {
+					memcpy(arp->mac_src,
+						tx_slave->dev->dev_addr,
+						ETH_ALEN);
+					break;
+				}
+			}
 		}
 		pr_debug("Server sent ARP Reply packet\n");
 	} else if (arp->op_code == htons(ARPOP_REQUEST)) {