Skip to content

Commit

Permalink
bonding: use the new options to correctly set last_arp_rx
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Veaceslav Falico authored and David S. Miller committed Feb 18, 2014
1 parent 52f65ef commit f2cb691
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f2cb691

Please sign in to comment.