From 17a02e0efcb6c716cd324d66d273f903a1dbe154 Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Thu, 7 Jan 2016 11:26:53 +0100 Subject: vxlan: fix test which detect duplicate vxlan iface commit 07b9b37c227cb8d88d478b4a9c5634fee514ede1 upstream. When a vxlan interface is created, the driver checks that there is not another vxlan interface with the same properties. To do this, it checks the existing vxlan udp socket. Since commit 1c51a9159dde, the creation of the vxlan socket is done only when the interface is set up, thus it breaks that test. Example: $ ip l a vxlan10 type vxlan id 10 group 239.0.0.10 dev eth0 dstport 0 $ ip l a vxlan11 type vxlan id 10 group 239.0.0.10 dev eth0 dstport 0 $ ip -br l | grep vxlan vxlan10 DOWN f2:55:1c:6a:fb:00 vxlan11 DOWN 7a:cb:b9:38:59:0d Instead of checking sockets, let's loop over the vxlan iface list. Fixes: 1c51a9159dde ("vxlan: fix race caused by dropping rtnl_unlock") Reported-by: Thomas Faivre Signed-off-by: Nicolas Dichtel Signed-off-by: David S. Miller [ luis: backported to 3.16: used davem's backport to 3.18 ] Signed-off-by: Luis Henriques --- include/net/vxlan.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 12196ce661d9..94f5391736fe 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -34,6 +34,11 @@ struct vxlan_sock { #define VXLAN_F_UDP_ZERO_CSUM6_TX 0x80 #define VXLAN_F_UDP_ZERO_CSUM6_RX 0x100 +/* Flags that are used in the receive path. These flags must match in + * order for a socket to be shareable + */ +#define VXLAN_F_RCV_FLAGS VXLAN_F_UDP_ZERO_CSUM6_RX + struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, vxlan_rcv_t *rcv, void *data, bool no_share, u32 flags); -- cgit v1.2.3