Skip to content

Commit 4967082

Browse files
NicolasDichteldavem330
authored andcommitted
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: 193523b ("vxlan: advertise netns of vxlan dev in fdb msg") Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5094c6f commit 4967082

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/net/vxlan.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
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)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ enum {
2525
NDA_VNI,
2626
NDA_IFINDEX,
2727
NDA_MASTER,
28-
NDA_NDM_IFINDEX_NETNSID,
28+
NDA_LINK_NETNSID,
2929
__NDA_MAX
3030
};
3131

0 commit comments

Comments
 (0)