summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com <sfeldma@cumulusnetworks.com>2013-12-12 14:10:45 -0800
committerDavid S. Miller <davem@davemloft.net>2013-12-14 01:07:32 -0500
commitd5c842544342fc3f13774ffc5581d4dd3975059b (patch)
tree6fc13e909d6f1971712da3d23558a867ee54b2a4 /drivers/net/bonding/bond_sysfs.c
parent29c4948293bfc426e52a921f4259eb3676961e81 (diff)
bonding: add arp_all_targets netlink support
Add IFLA_BOND_ARP_ALL_TARGETS to allow get/set of bonding parameter arp_all_targets via netlink. Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index bda00a01393..dad9bea9512 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -399,7 +399,7 @@ static ssize_t bonding_store_arp_all_targets(struct device *d,
const char *buf, size_t count)
{
struct bonding *bond = to_bond(d);
- int new_value;
+ int new_value, ret;
new_value = bond_parse_parm(buf, arp_all_targets_tbl);
if (new_value < 0) {
@@ -407,13 +407,17 @@ static ssize_t bonding_store_arp_all_targets(struct device *d,
bond->dev->name, buf);
return -EINVAL;
}
- pr_info("%s: setting arp_all_targets to %s (%d).\n",
- bond->dev->name, arp_all_targets_tbl[new_value].modename,
- new_value);
- bond->params.arp_all_targets = new_value;
+ if (!rtnl_trylock())
+ return restart_syscall();
- return count;
+ ret = bond_option_arp_all_targets_set(bond, new_value);
+ if (!ret)
+ ret = count;
+
+ rtnl_unlock();
+
+ return ret;
}
static DEVICE_ATTR(arp_all_targets, S_IRUGO | S_IWUSR,