diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-01-22 14:53:22 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-22 15:38:42 -0800 |
commit | 1df6b6aa334c99b39f9366f4199b7f5e479a8899 (patch) | |
tree | db9fc82c70ba94d02bd646650b914cb910ff8f80 /drivers/net/bonding/bond_main.c | |
parent | edf36b24c58dbbd5f2e708096537bf0a88ffa477 (diff) |
bonding: convert fail_over_mac to use the new option API
This patch adds the necessary changes so fail_over_mac would use
the new bonding option API. Also fixes a trivial copy/paste error in
bond_check_params where the wrong variable was used for the error msg.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 103b6af30474..4fe3634a77d3 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -214,13 +214,6 @@ const struct bond_parm_tbl bond_lacp_tbl[] = { { NULL, -1}, }; -const struct bond_parm_tbl fail_over_mac_tbl[] = { -{ "none", BOND_FOM_NONE}, -{ "active", BOND_FOM_ACTIVE}, -{ "follow", BOND_FOM_FOLLOW}, -{ NULL, -1}, -}; - const struct bond_parm_tbl pri_reselect_tbl[] = { { "always", BOND_PRI_RESELECT_ALWAYS}, { "better", BOND_PRI_RESELECT_BETTER}, @@ -4280,14 +4273,15 @@ static int bond_check_params(struct bond_params *params) } if (fail_over_mac) { - fail_over_mac_value = bond_parse_parm(fail_over_mac, - fail_over_mac_tbl); - if (fail_over_mac_value == -1) { + bond_opt_initstr(&newval, fail_over_mac); + valptr = bond_opt_parse(bond_opt_get(BOND_OPT_FAIL_OVER_MAC), + &newval); + if (!valptr) { pr_err("Error: invalid fail_over_mac \"%s\"\n", - arp_validate == NULL ? "NULL" : arp_validate); + fail_over_mac); return -EINVAL; } - + fail_over_mac_value = valptr->value; if (bond_mode != BOND_MODE_ACTIVEBACKUP) pr_warning("Warning: fail_over_mac only affects active-backup mode.\n"); } else { |