Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nicolas Dichtel and committed by
David S. Miller
4967082b 5094c6f8

+4 -3
+3 -2
drivers/net/vxlan.c
··· 341 341 ndm->ndm_type = RTN_UNICAST; 342 342 343 343 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))) 346 346 goto nla_put_failure; 347 347 348 348 if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) ··· 385 385 + nla_total_size(sizeof(__be16)) /* NDA_PORT */ 386 386 + nla_total_size(sizeof(__be32)) /* NDA_VNI */ 387 387 + nla_total_size(sizeof(__u32)) /* NDA_IFINDEX */ 388 + + nla_total_size(sizeof(__s32)) /* NDA_LINK_NETNSID */ 388 389 + nla_total_size(sizeof(struct nda_cacheinfo)); 389 390 } 390 391
+1 -1
include/uapi/linux/neighbour.h
··· 25 25 NDA_VNI, 26 26 NDA_IFINDEX, 27 27 NDA_MASTER, 28 - NDA_NDM_IFINDEX_NETNSID, 28 + NDA_LINK_NETNSID, 29 29 __NDA_MAX 30 30 }; 31 31