aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2014-02-18 01:48:40 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-18 16:47:14 -0500
commit896149ff1b2c48962b7e8eee797552c61f8d5b93 (patch)
treeeb06df4894a8713ba98c42705a929bc4ba414117
parent3fe68df97c7f132495664358e0bfbfcd4ca7809c (diff)
bonding: extend arp_validate to be able to receive unvalidated arp-only traffic
Currently we can either receive any traffic as a proff of slave being up, or only *validated* arp traffic (i.e. with src/dst ip checked). Add an option to be able to specify if we want to receive non-validated arp traffic only. CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_options.c13
-rw-r--r--drivers/net/bonding/bonding.h11
2 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index ad20c8ca11b6..5f997b9af54d 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -47,11 +47,14 @@ static struct bond_opt_value bond_xmit_hashtype_tbl[] = {
47}; 47};
48 48
49static struct bond_opt_value bond_arp_validate_tbl[] = { 49static struct bond_opt_value bond_arp_validate_tbl[] = {
50 { "none", BOND_ARP_VALIDATE_NONE, BOND_VALFLAG_DEFAULT}, 50 { "none", BOND_ARP_VALIDATE_NONE, BOND_VALFLAG_DEFAULT},
51 { "active", BOND_ARP_VALIDATE_ACTIVE, 0}, 51 { "active", BOND_ARP_VALIDATE_ACTIVE, 0},
52 { "backup", BOND_ARP_VALIDATE_BACKUP, 0}, 52 { "backup", BOND_ARP_VALIDATE_BACKUP, 0},
53 { "all", BOND_ARP_VALIDATE_ALL, 0}, 53 { "all", BOND_ARP_VALIDATE_ALL, 0},
54 { NULL, -1, 0}, 54 { "filter", BOND_ARP_FILTER, 0},
55 { "filter_active", BOND_ARP_FILTER_ACTIVE, 0},
56 { "filter_backup", BOND_ARP_FILTER_BACKUP, 0},
57 { NULL, -1, 0},
55}; 58};
56 59
57static struct bond_opt_value bond_arp_all_targets_tbl[] = { 60static struct bond_opt_value bond_arp_all_targets_tbl[] = {
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 86ccfb9f71cc..ab2e651d7bc3 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -342,6 +342,11 @@ static inline bool bond_is_active_slave(struct slave *slave)
342#define BOND_ARP_VALIDATE_BACKUP (1 << BOND_STATE_BACKUP) 342#define BOND_ARP_VALIDATE_BACKUP (1 << BOND_STATE_BACKUP)
343#define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \ 343#define BOND_ARP_VALIDATE_ALL (BOND_ARP_VALIDATE_ACTIVE | \
344 BOND_ARP_VALIDATE_BACKUP) 344 BOND_ARP_VALIDATE_BACKUP)
345#define BOND_ARP_FILTER (BOND_ARP_VALIDATE_ALL + 1)
346#define BOND_ARP_FILTER_ACTIVE (BOND_ARP_VALIDATE_ACTIVE | \
347 BOND_ARP_FILTER)
348#define BOND_ARP_FILTER_BACKUP (BOND_ARP_VALIDATE_BACKUP | \
349 BOND_ARP_FILTER)
345 350
346static inline int slave_do_arp_validate(struct bonding *bond, 351static inline int slave_do_arp_validate(struct bonding *bond,
347 struct slave *slave) 352 struct slave *slave)
@@ -349,6 +354,12 @@ static inline int slave_do_arp_validate(struct bonding *bond,
349 return bond->params.arp_validate & (1 << bond_slave_state(slave)); 354 return bond->params.arp_validate & (1 << bond_slave_state(slave));
350} 355}
351 356
357static inline int slave_do_arp_validate_only(struct bonding *bond,
358 struct slave *slave)
359{
360 return bond->params.arp_validate & BOND_ARP_FILTER;
361}
362
352/* Get the oldest arp which we've received on this slave for bond's 363/* Get the oldest arp which we've received on this slave for bond's
353 * arp_targets. 364 * arp_targets.
354 */ 365 */