Commit 4967082b authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

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: 193523bf ("vxlan: advertise netns of vxlan dev in fdb msg")
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5094c6f8
...@@ -341,8 +341,8 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan, ...@@ -341,8 +341,8 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
ndm->ndm_type = RTN_UNICAST; ndm->ndm_type = RTN_UNICAST;
if (!net_eq(dev_net(vxlan->dev), vxlan->net) && if (!net_eq(dev_net(vxlan->dev), vxlan->net) &&
nla_put_s32(skb, NDA_NDM_IFINDEX_NETNSID, nla_put_s32(skb, NDA_LINK_NETNSID,
peernet2id(vxlan->net, dev_net(vxlan->dev)))) peernet2id(dev_net(vxlan->dev), vxlan->net)))
goto nla_put_failure; goto nla_put_failure;
if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) 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) ...@@ -385,6 +385,7 @@ static inline size_t vxlan_nlmsg_size(void)
+ nla_total_size(sizeof(__be16)) /* NDA_PORT */ + nla_total_size(sizeof(__be16)) /* NDA_PORT */
+ nla_total_size(sizeof(__be32)) /* NDA_VNI */ + nla_total_size(sizeof(__be32)) /* NDA_VNI */
+ nla_total_size(sizeof(__u32)) /* NDA_IFINDEX */ + nla_total_size(sizeof(__u32)) /* NDA_IFINDEX */
+ nla_total_size(sizeof(__s32)) /* NDA_LINK_NETNSID */
+ nla_total_size(sizeof(struct nda_cacheinfo)); + nla_total_size(sizeof(struct nda_cacheinfo));
} }
......
...@@ -25,7 +25,7 @@ enum { ...@@ -25,7 +25,7 @@ enum {
NDA_VNI, NDA_VNI,
NDA_IFINDEX, NDA_IFINDEX,
NDA_MASTER, NDA_MASTER,
NDA_NDM_IFINDEX_NETNSID, NDA_LINK_NETNSID,
__NDA_MAX __NDA_MAX
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment