aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_netlink.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com <sfeldma@cumulusnetworks.com>2013-12-12 17:10:45 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-14 01:07:32 -0500
commitd5c842544342fc3f13774ffc5581d4dd3975059b (patch)
tree6fc13e909d6f1971712da3d23558a867ee54b2a4 /drivers/net/bonding/bond_netlink.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_netlink.c')
-rw-r--r--drivers/net/bonding/bond_netlink.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 8588cb91caa9..d7d84db9eed7 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -31,6 +31,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
31 [IFLA_BOND_ARP_INTERVAL] = { .type = NLA_U32 }, 31 [IFLA_BOND_ARP_INTERVAL] = { .type = NLA_U32 },
32 [IFLA_BOND_ARP_IP_TARGET] = { .type = NLA_NESTED }, 32 [IFLA_BOND_ARP_IP_TARGET] = { .type = NLA_NESTED },
33 [IFLA_BOND_ARP_VALIDATE] = { .type = NLA_U32 }, 33 [IFLA_BOND_ARP_VALIDATE] = { .type = NLA_U32 },
34 [IFLA_BOND_ARP_ALL_TARGETS] = { .type = NLA_U32 },
34}; 35};
35 36
36static int bond_validate(struct nlattr *tb[], struct nlattr *data[]) 37static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -145,6 +146,14 @@ static int bond_changelink(struct net_device *bond_dev,
145 if (err) 146 if (err)
146 return err; 147 return err;
147 } 148 }
149 if (data[IFLA_BOND_ARP_ALL_TARGETS]) {
150 int arp_all_targets =
151 nla_get_u32(data[IFLA_BOND_ARP_ALL_TARGETS]);
152
153 err = bond_option_arp_all_targets_set(bond, arp_all_targets);
154 if (err)
155 return err;
156 }
148 return 0; 157 return 0;
149} 158}
150 159
@@ -172,6 +181,7 @@ static size_t bond_get_size(const struct net_device *bond_dev)
172 /* IFLA_BOND_ARP_IP_TARGET */ 181 /* IFLA_BOND_ARP_IP_TARGET */
173 nla_total_size(sizeof(u32)) * BOND_MAX_ARP_TARGETS + 182 nla_total_size(sizeof(u32)) * BOND_MAX_ARP_TARGETS +
174 nla_total_size(sizeof(u32)) + /* IFLA_BOND_ARP_VALIDATE */ 183 nla_total_size(sizeof(u32)) + /* IFLA_BOND_ARP_VALIDATE */
184 nla_total_size(sizeof(u32)) + /* IFLA_BOND_ARP_ALL_TARGETS */
175 0; 185 0;
176} 186}
177 187
@@ -227,6 +237,10 @@ static int bond_fill_info(struct sk_buff *skb,
227 if (nla_put_u32(skb, IFLA_BOND_ARP_VALIDATE, bond->params.arp_validate)) 237 if (nla_put_u32(skb, IFLA_BOND_ARP_VALIDATE, bond->params.arp_validate))
228 goto nla_put_failure; 238 goto nla_put_failure;
229 239
240 if (nla_put_u32(skb, IFLA_BOND_ARP_ALL_TARGETS,
241 bond->params.arp_all_targets))
242 goto nla_put_failure;
243
230 return 0; 244 return 0;
231 245
232nla_put_failure: 246nla_put_failure: