diff options
author | sfeldma@cumulusnetworks.com <sfeldma@cumulusnetworks.com> | 2013-12-15 16:42:05 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-17 16:08:45 -0500 |
commit | 89901972de4c00e74e56529804493734d77ee3d3 (patch) | |
tree | 1ca8eb5d436b00fb9b5c921efdd74ed5bd64dfaa /drivers/net/bonding/bond_options.c | |
parent | 8a41ae4496e534a8b68d9bc3c79113e16d1fcd4c (diff) | |
download | blackbird-obmc-linux-89901972de4c00e74e56529804493734d77ee3d3.tar.gz blackbird-obmc-linux-89901972de4c00e74e56529804493734d77ee3d3.zip |
bonding: add fail_over_mac attribute netlink support
Add IFLA_BOND_FAIL_OVER_MAC to allow get/set of bonding parameter
fail_over_mac via netlink.
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_options.c')
-rw-r--r-- | drivers/net/bonding/bond_options.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index 80a9df4e4bf7..86f462008932 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c @@ -535,3 +535,19 @@ int bond_option_primary_reselect_set(struct bonding *bond, int primary_reselect) return 0; } + +int bond_option_fail_over_mac_set(struct bonding *bond, int fail_over_mac) +{ + if (bond_has_slaves(bond)) { + pr_err("%s: Can't alter fail_over_mac with slaves in bond.\n", + bond->dev->name); + return -EPERM; + } + + bond->params.fail_over_mac = fail_over_mac; + pr_info("%s: Setting fail_over_mac to %s (%d).\n", + bond->dev->name, fail_over_mac_tbl[fail_over_mac].modename, + fail_over_mac); + + return 0; +} |