From 449d57cd3d8ac22375b3b0193605d8ddc5d3978e Mon Sep 17 00:00:00 2001 From: "zheng.li" Date: Tue, 27 Nov 2012 23:57:04 +0000 Subject: [PATCH] --- yaml --- r: 341638 b: refs/heads/master c: 567b871e503316b0927e54a3d7c86d50b722d955 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/bonding/bond_alb.c | 6 ++++++ trunk/drivers/net/bonding/bonding.h | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 051973a54feb..4068ef95e032 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e7165030db8e932a9a968f7015cd3b2e984f8e7c +refs/heads/master: 567b871e503316b0927e54a3d7c86d50b722d955 diff --git a/trunk/drivers/net/bonding/bond_alb.c b/trunk/drivers/net/bonding/bond_alb.c index e15cc11edbbe..6fecb52327df 100644 --- a/trunk/drivers/net/bonding/bond_alb.c +++ b/trunk/drivers/net/bonding/bond_alb.c @@ -694,6 +694,12 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) struct arp_pkt *arp = arp_pkt(skb); struct slave *tx_slave = NULL; + /* Don't modify or load balance ARPs that do not originate locally + * (e.g.,arrive via a bridge). + */ + if (!bond_slave_has_mac(bond, arp->mac_src)) + return NULL; + if (arp->op_code == htons(ARPOP_REPLY)) { /* the arp must be sent on the selected * rx channel diff --git a/trunk/drivers/net/bonding/bonding.h b/trunk/drivers/net/bonding/bonding.h index f8af2fcd3d16..6dded569b111 100644 --- a/trunk/drivers/net/bonding/bonding.h +++ b/trunk/drivers/net/bonding/bonding.h @@ -22,6 +22,7 @@ #include #include #include +#include #include "bond_3ad.h" #include "bond_alb.h" @@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir(struct bond_net *bn) } #endif +static inline struct slave *bond_slave_has_mac(struct bonding *bond, + const u8 *mac) +{ + int i = 0; + struct slave *tmp; + + bond_for_each_slave(bond, tmp, i) + if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr)) + return tmp; + + return NULL; +} /* exported from bond_main.c */ extern int bond_net_id;