aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2015-01-26 08:10:53 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-27 20:11:07 -0500
commit4967082b469320eeba54ffbca632af1962858fb7 (patch)
tree358f3258d1ab3bbcf261786d3bd66a7a9650943b
parent5094c6f8755407e2d97bfbb4c76fefca3274d3c7 (diff)
vxlan: advertise link netns in fdb messages
Previous commit is based on a wrong assumption, fdb messages are always sent into the netns where the interface stands (see vxlan_fdb_notify()). These fdb messages doesn't embed the rtnl attribute IFLA_LINK_NETNSID, thus we need to add it (useful to interpret NDA_IFINDEX or NDA_DST for example). Note also that vxlan_nlmsg_size() was not updated. Fixes: 193523bf9373 ("vxlan: advertise netns of vxlan dev in fdb msg") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/vxlan.c5
-rw-r--r--include/uapi/linux/neighbour.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 87736e65cd15..31bac2a21ce3 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -341,8 +341,8 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
341 ndm->ndm_type = RTN_UNICAST; 341 ndm->ndm_type = RTN_UNICAST;
342 342
343 if (!net_eq(dev_net(vxlan->dev), vxlan->net) && 343 if (!net_eq(dev_net(vxlan->dev), vxlan->net) &&
344 nla_put_s32(skb, NDA_NDM_IFINDEX_NETNSID, 344 nla_put_s32(skb, NDA_LINK_NETNSID,
345 peernet2id(vxlan->net, dev_net(vxlan->dev)))) 345 peernet2id(dev_net(vxlan->dev), vxlan->net)))
346 goto nla_put_failure; 346 goto nla_put_failure;
347 347
348 if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) 348 if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr))
@@ -385,6 +385,7 @@ static inline size_t vxlan_nlmsg_size(void)
385 + nla_total_size(sizeof(__be16)) /* NDA_PORT */ 385 + nla_total_size(sizeof(__be16)) /* NDA_PORT */
386 + nla_total_size(sizeof(__be32)) /* NDA_VNI */ 386 + nla_total_size(sizeof(__be32)) /* NDA_VNI */
387 + nla_total_size(sizeof(__u32)) /* NDA_IFINDEX */ 387 + nla_total_size(sizeof(__u32)) /* NDA_IFINDEX */
388 + nla_total_size(sizeof(__s32)) /* NDA_LINK_NETNSID */
388 + nla_total_size(sizeof(struct nda_cacheinfo)); 389 + nla_total_size(sizeof(struct nda_cacheinfo));
389} 390}
390 391
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
index 38f236853cc0..3873a35509aa 100644
--- a/include/uapi/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
@@ -25,7 +25,7 @@ enum {
25 NDA_VNI, 25 NDA_VNI,
26 NDA_IFINDEX, 26 NDA_IFINDEX,
27 NDA_MASTER, 27 NDA_MASTER,
28 NDA_NDM_IFINDEX_NETNSID, 28 NDA_LINK_NETNSID,
29 __NDA_MAX 29 __NDA_MAX
30}; 30};
31 31