From edf36b24c58dbbd5f2e708096537bf0a88ffa477 Mon Sep 17 00:00:00 2001 From: Nikolay Aleksandrov Date: Wed, 22 Jan 2014 14:53:21 +0100 Subject: bonding: convert arp_all_targets to use the new option API This patch adds the necessary changes so arp_all_targets would use the new bonding option API. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller --- drivers/net/bonding/bond_main.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'drivers/net/bonding/bond_main.c') diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3903c87c8b8c..103b6af30474 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -214,12 +214,6 @@ const struct bond_parm_tbl bond_lacp_tbl[] = { { NULL, -1}, }; -const struct bond_parm_tbl arp_all_targets_tbl[] = { -{ "any", BOND_ARP_TARGETS_ANY}, -{ "all", BOND_ARP_TARGETS_ALL}, -{ NULL, -1}, -}; - const struct bond_parm_tbl fail_over_mac_tbl[] = { { "none", BOND_FOM_NONE}, { "active", BOND_FOM_ACTIVE}, @@ -4231,13 +4225,15 @@ static int bond_check_params(struct bond_params *params) arp_all_targets_value = 0; if (arp_all_targets) { - arp_all_targets_value = bond_parse_parm(arp_all_targets, - arp_all_targets_tbl); - - if (arp_all_targets_value == -1) { + bond_opt_initstr(&newval, arp_all_targets); + valptr = bond_opt_parse(bond_opt_get(BOND_OPT_ARP_ALL_TARGETS), + &newval); + if (!valptr) { pr_err("Error: invalid arp_all_targets_value \"%s\"\n", arp_all_targets); arp_all_targets_value = 0; + } else { + arp_all_targets_value = valptr->value; } } -- cgit v1.2.3