]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vxlan: fix test which detect duplicate vxlan iface
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 7 Jan 2016 10:26:53 +0000 (11:26 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:43:23 +0000 (15:43 -0700)
commit9b691e4f6e089a6838d871b6b5a99d136051e4ba
treefd336448a106fb0b6bd357e486f8cf3091038736
parent1d5a026a4e6a3ab8f0c7f1fd00cc7d895bf5fa57
vxlan: fix test which detect duplicate vxlan iface

Orabug: 23330552

[ Upstream commit 07b9b37c227cb8d88d478b4a9c5634fee514ede1 ]

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 <BROADCAST,MULTICAST>
vxlan11          DOWN           7a:cb:b9:38:59:0d <BROADCAST,MULTICAST>

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 <thomas.faivre@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a33704eb60850ac837ef83ecc380f5f6b2aa2906)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/net/vxlan.c