[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1389977940-17084-8-git-send-email-vfalico@redhat.com>
Date: Fri, 17 Jan 2014 17:58:55 +0100
From: Veaceslav Falico <vfalico@...hat.com>
To: netdev@...r.kernel.org
Cc: Veaceslav Falico <vfalico@...hat.com>,
Rob Landley <rob@...dley.net>,
"David S. Miller" <davem@...emloft.net>,
Nikolay Aleksandrov <nikolay@...hat.com>,
Ding Tianhong <dingtianhong@...wei.com>,
Neil Horman <nhorman@...driver.com>
Subject: [PATCH v2 net-next 07/12] 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@...dley.net>
CC: "David S. Miller" <davem@...emloft.net>
CC: Nikolay Aleksandrov <nikolay@...hat.com>
CC: Ding Tianhong <dingtianhong@...wei.com>
CC: Neil Horman <nhorman@...driver.com>
Signed-off-by: Veaceslav Falico <vfalico@...hat.com>
---
drivers/net/bonding/bond_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 532a452..48491d9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2290,15 +2290,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);
--
1.8.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists