History

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.

Nicolas Dichtel committed 11 years ago

Commit 49670821 parent 5094c6f2 files · +4 −3Browse files

Unified · Split

2 files
  1. drivers/net/vxlan.c +3 −2
  2. include/uapi/linux/neighbour.h +1 −1
drivers/net/vxlan.c+3−2
@@ -341,8 +341,8 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan, · 340 unmodified lines
341341 ndm->ndm_type = RTN_UNICAST;
342342
343343 if (!net_eq(dev_net(vxlan->dev), vxlan->net) &&
344− nla_put_s32(skb, NDA_NDM_IFINDEX_NETNSID,
345− peernet2id(vxlan->net, dev_net(vxlan->dev))))
344+ nla_put_s32(skb, NDA_LINK_NETNSID,
345+ peernet2id(dev_net(vxlan->dev), vxlan->net)))
346346 goto nla_put_failure;
347347
348348 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) · 36 unmodified lines
385385 + nla_total_size(sizeof(__be16)) /* NDA_PORT */
386386 + nla_total_size(sizeof(__be32)) /* NDA_VNI */
387387 + nla_total_size(sizeof(__u32)) /* NDA_IFINDEX */
388+ + nla_total_size(sizeof(__s32)) /* NDA_LINK_NETNSID */
388389 + nla_total_size(sizeof(struct nda_cacheinfo));
389390 }
390391
include/uapi/linux/neighbour.h+1−1
@@ -25,7 +25,7 @@ enum { · 24 unmodified lines
2525 NDA_VNI,
2626 NDA_IFINDEX,
2727 NDA_MASTER,
28− NDA_NDM_IFINDEX_NETNSID,
28+ NDA_LINK_NETNSID,
2929 __NDA_MAX
3030 };
3131

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t