• Nicolas Dichtel's avatar
    vxlan: fix test which detect duplicate vxlan iface · 07b9b37c
    Nicolas Dichtel authored
    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 1c51a915, 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: 1c51a915 ("vxlan: fix race caused by dropping rtnl_unlock")
    Reported-by: default avatarThomas Faivre <thomas.faivre@6wind.com>
    Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    07b9b37c
vxlan.c 81.9 KB