aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/bonding/bond_netlink.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-01-22 14:53:24 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-22 15:38:42 -0800
commit4fb0ef585eb2825ef4e542c2b1d302dc53f36860 (patch)
tree0979b3f487b2bd52a4d697c0a7d59201d7f1edd1 /drivers/net/bonding/bond_netlink.c
parent7bdb04ed0dbf9f0e94110be43db4f8bb7df58de2 (diff)
bonding: convert arp_ip_target to use the new option API
This patch adds the necessary changes so arp_ip_target would use the new bonding option API. This option is an exception because of the way it's currently implemented that's why its netlink code is a bit different from the other options to keep the functionality as before and at the same time to have a single set function. This patch also fixes a few stylistic errors. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_netlink.c')
-rw-r--r--drivers/net/bonding/bond_netlink.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 74463f3db8b6..9164a5a8e44f 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -172,16 +172,23 @@ static int bond_changelink(struct net_device *bond_dev,
return err;
}
if (data[IFLA_BOND_ARP_IP_TARGET]) {
- __be32 targets[BOND_MAX_ARP_TARGETS] = { 0, };
struct nlattr *attr;
int i = 0, rem;
+ bond_option_arp_ip_targets_clear(bond);
nla_for_each_nested(attr, data[IFLA_BOND_ARP_IP_TARGET], rem) {
__be32 target = nla_get_be32(attr);
- targets[i++] = target;
- }
- err = bond_option_arp_ip_targets_set(bond, targets, i);
+ bond_opt_initval(&newval, target);
+ err = __bond_opt_set(bond, BOND_OPT_ARP_TARGETS,
+ &newval);
+ if (err)
+ break;
+ i++;
+ }
+ if (i == 0 && bond->params.arp_interval)
+ pr_warn("%s: removing last arp target with arp_interval on\n",
+ bond->dev->name);
if (err)
return err;
}