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
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) · 36 unmodified lines
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
include/uapi/linux/neighbour.h+1−1
@@ -25,7 +25,7 @@ enum { · 24 unmodified lines
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_MAX29 __NDA_MAX
30};30};
31 31

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