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.
Unified · Split
| @@ -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 | ||
| @@ -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_MAX | 29 | __NDA_MAX |
| 30 | }; | 30 | }; |
| 31 | 31 | ||