summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2014-02-18 07:48:42 +0100
committerDavid S. Miller <davem@davemloft.net>2014-02-18 22:47:15 +0100
commitf2cb691a7735d7903398aa914b7e567536ea98e4 (patch)
tree6ef8dc014244dac6b0811472c9158dbd224dd706 /drivers/net/bonding
parentbonding: document the new _arp options for arp_validate (diff)
downloadlinux-f2cb691a7735d7903398aa914b7e567536ea98e4.tar.xz
linux-f2cb691a7735d7903398aa914b7e567536ea98e4.zip
bonding: use the new options to correctly set last_arp_rx
Now that the options are in place - arp_validate can be set to receive all the traffic or only arp packets to verify if the slave is up, when the slave isn't validated. CC: Rob Landley <rob@landley.net> CC: "David S. Miller" <davem@davemloft.net> CC: Nikolay Aleksandrov <nikolay@redhat.com> CC: Ding Tianhong <dingtianhong@huawei.com> CC: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 257ee7f05645..3fe81cdbd8fb 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2255,15 +2255,16 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
struct arphdr *arp = (struct arphdr *)skb->data;
unsigned char *arp_ptr;
__be32 sip, tip;
- int alen;
+ int alen, is_arp = skb->protocol == __cpu_to_be16(ETH_P_ARP);
- slave->last_arp_rx = jiffies;
-
- if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
+ if (!slave_do_arp_validate(bond, slave)) {
+ if ((slave_do_arp_validate_only(bond, slave) && is_arp) ||
+ !slave_do_arp_validate_only(bond, slave))
+ slave->last_arp_rx = jiffies;
return RX_HANDLER_ANOTHER;
-
- if (!slave_do_arp_validate(bond, slave))
- goto out_unlock;
+ } else if (!is_arp) {
+ return RX_HANDLER_ANOTHER;
+ }
alen = arp_hdr_len(bond->dev);