diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-01-20 09:15:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-23 20:51:15 -0500 |
commit | 193523bf937309d57c6dd7839bcf34d7a029dbee (patch) | |
tree | 0dbb105a5d413ab622e6b9b5d18137ec93d7f809 /drivers/net/vxlan.c | |
parent | e5f4e7b9ff331c6995af826b222681528de574b6 (diff) |
vxlan: advertise netns of vxlan dev in fdb msg
Netlink FDB messages are sent in the link netns. The header of these messages
contains the ifindex (ndm_ifindex) of the netdevice, but this ifindex is
unusable in case of x-netns vxlan.
I named the new attribute NDA_NDM_IFINDEX_NETNSID, to avoid confusion with
NDA_IFINDEX.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 0346eaa6d236..19d3664ab9dd 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -339,6 +339,11 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan, | |||
339 | ndm->ndm_flags = fdb->flags; | 339 | ndm->ndm_flags = fdb->flags; |
340 | ndm->ndm_type = RTN_UNICAST; | 340 | ndm->ndm_type = RTN_UNICAST; |
341 | 341 | ||
342 | if (!net_eq(dev_net(vxlan->dev), vxlan->net) && | ||
343 | nla_put_s32(skb, NDA_NDM_IFINDEX_NETNSID, | ||
344 | peernet2id(vxlan->net, dev_net(vxlan->dev)))) | ||
345 | goto nla_put_failure; | ||
346 | |||
342 | if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) | 347 | if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) |
343 | goto nla_put_failure; | 348 | goto nla_put_failure; |
344 | 349 | ||