aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_netlink.c')
-rw-r--r--drivers/net/bonding/bond_netlink.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 6d30e5db9e3c..8588cb91caa9 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -30,6 +30,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
30 [IFLA_BOND_USE_CARRIER] = { .type = NLA_U8 }, 30 [IFLA_BOND_USE_CARRIER] = { .type = NLA_U8 },
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}; 34};
34 35
35static int bond_validate(struct nlattr *tb[], struct nlattr *data[]) 36static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -131,6 +132,19 @@ static int bond_changelink(struct net_device *bond_dev,
131 if (err) 132 if (err)
132 return err; 133 return err;
133 } 134 }
135 if (data[IFLA_BOND_ARP_VALIDATE]) {
136 int arp_validate = nla_get_u32(data[IFLA_BOND_ARP_VALIDATE]);
137
138 if (arp_validate && miimon) {
139 pr_err("%s: ARP validating cannot be used with MII monitoring.\n",
140 bond->dev->name);
141 return -EINVAL;
142 }
143
144 err = bond_option_arp_validate_set(bond, arp_validate);
145 if (err)
146 return err;
147 }
134 return 0; 148 return 0;
135} 149}
136 150
@@ -157,6 +171,7 @@ static size_t bond_get_size(const struct net_device *bond_dev)
157 nla_total_size(sizeof(u32)) + /* IFLA_BOND_ARP_INTERVAL */ 171 nla_total_size(sizeof(u32)) + /* IFLA_BOND_ARP_INTERVAL */
158 /* IFLA_BOND_ARP_IP_TARGET */ 172 /* IFLA_BOND_ARP_IP_TARGET */
159 nla_total_size(sizeof(u32)) * BOND_MAX_ARP_TARGETS + 173 nla_total_size(sizeof(u32)) * BOND_MAX_ARP_TARGETS +
174 nla_total_size(sizeof(u32)) + /* IFLA_BOND_ARP_VALIDATE */
160 0; 175 0;
161} 176}
162 177
@@ -209,6 +224,9 @@ static int bond_fill_info(struct sk_buff *skb,
209 else 224 else
210 nla_nest_cancel(skb, targets); 225 nla_nest_cancel(skb, targets);
211 226
227 if (nla_put_u32(skb, IFLA_BOND_ARP_VALIDATE, bond->params.arp_validate))
228 goto nla_put_failure;
229
212 return 0; 230 return 0;
213 231
214nla_put_failure: 232nla_put_failure: