summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_options.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com2013-12-16 01:42:05 +0100
committerDavid S. Miller2013-12-17 22:08:45 +0100
commit89901972de4c00e74e56529804493734d77ee3d3 (patch)
tree1ca8eb5d436b00fb9b5c921efdd74ed5bd64dfaa /drivers/net/bonding/bond_options.c
parentbonding: add primary_select attribute netlink support (diff)
downloadkernel-qcow2-linux-89901972de4c00e74e56529804493734d77ee3d3.tar.gz
kernel-qcow2-linux-89901972de4c00e74e56529804493734d77ee3d3.tar.xz
kernel-qcow2-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.c16
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;
+}