aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_netlink.c
diff options
context:
space:
mode:
authorsfeldma@cumulusnetworks.com <sfeldma@cumulusnetworks.com>2013-12-18 00:30:09 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-19 18:32:09 -0500
commit2c9839c143bbc8c6612f56351dae8d57111aee37 (patch)
tree94e73e0c75f6c83cd00ff5dc03e61dba3b440cca /drivers/net/bonding/bond_netlink.c
parentde47c4ab25d43a98e629cc11c2d90ae56145b35d (diff)
bonding: add num_grat_arp attribute netlink support
Add IFLA_BOND_NUM_PEER_NOTIF to allow get/set of bonding parameter num_grat_arp via netlink. Bonding parameter num_unsol_na is synonymous with num_grat_arp, so add only one netlink attribute to represent both bonding parameters. 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 e161c9cbd91e..07123a0fcf5d 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -37,6 +37,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
37 [IFLA_BOND_FAIL_OVER_MAC] = { .type = NLA_U8 }, 37 [IFLA_BOND_FAIL_OVER_MAC] = { .type = NLA_U8 },
38 [IFLA_BOND_XMIT_HASH_POLICY] = { .type = NLA_U8 }, 38 [IFLA_BOND_XMIT_HASH_POLICY] = { .type = NLA_U8 },
39 [IFLA_BOND_RESEND_IGMP] = { .type = NLA_U32 }, 39 [IFLA_BOND_RESEND_IGMP] = { .type = NLA_U32 },
40 [IFLA_BOND_NUM_PEER_NOTIF] = { .type = NLA_U8 },
40}; 41};
41 42
42static int bond_validate(struct nlattr *tb[], struct nlattr *data[]) 43static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -204,6 +205,14 @@ static int bond_changelink(struct net_device *bond_dev,
204 if (err) 205 if (err)
205 return err; 206 return err;
206 } 207 }
208 if (data[IFLA_BOND_NUM_PEER_NOTIF]) {
209 int num_peer_notif =
210 nla_get_u8(data[IFLA_BOND_NUM_PEER_NOTIF]);
211
212 err = bond_option_num_peer_notif_set(bond, num_peer_notif);
213 if (err)
214 return err;
215 }
207 return 0; 216 return 0;
208} 217}
209 218
@@ -237,6 +246,7 @@ static size_t bond_get_size(const struct net_device *bond_dev)
237 nla_total_size(sizeof(u8)) + /* IFLA_BOND_FAIL_OVER_MAC */ 246 nla_total_size(sizeof(u8)) + /* IFLA_BOND_FAIL_OVER_MAC */
238 nla_total_size(sizeof(u8)) + /* IFLA_BOND_XMIT_HASH_POLICY */ 247 nla_total_size(sizeof(u8)) + /* IFLA_BOND_XMIT_HASH_POLICY */
239 nla_total_size(sizeof(u32)) + /* IFLA_BOND_RESEND_IGMP */ 248 nla_total_size(sizeof(u32)) + /* IFLA_BOND_RESEND_IGMP */
249 nla_total_size(sizeof(u8)) + /* IFLA_BOND_NUM_PEER_NOTIF */
240 0; 250 0;
241} 251}
242 252
@@ -317,6 +327,10 @@ static int bond_fill_info(struct sk_buff *skb,
317 bond->params.resend_igmp)) 327 bond->params.resend_igmp))
318 goto nla_put_failure; 328 goto nla_put_failure;
319 329
330 if (nla_put_u8(skb, IFLA_BOND_NUM_PEER_NOTIF,
331 bond->params.num_peer_notif))
332 goto nla_put_failure;
333
320 return 0; 334 return 0;
321 335
322nla_put_failure: 336nla_put_failure: