Subject: Re: vxlan regression: multiple VXLANs on a single multicast group broken in kernel 4.1

From: Marcelo Ricardo Leitner <[email-masked]>
Date: Tue, 25 Aug 2015 15:52:08 -0300

Em 25-08-2015 14:35, John Nielsen escreveu:
> After updating the kernel on a KVM host, I discovered yesterday that I can no longer use more than one vxlan interface on a single multicast group/address. The interfaces can be created but only the first one may be brought up:
>
> # ip link add vx100 type vxlan id 100 group 239.0.0.1 dev eth0
> # ip link add vx200 type vxlan id 200 group 239.0.0.1 dev eth0
> # ip link set up dev vx100
> # ip link set up dev vx200
> RTNETLINK answers: Address already in use
>
> Using unique group addresses (one VNI per group) still works as expected. The problem is not present in kernel 4.0.5 but it is in kernel 4.1.0.
>
> I suspect (but have not verified) that the regression was caused by this commit:
> vxlan: Move socket initialization to within rtnl scope 56ef9c909b40483d2c8cb63fcbf83865f162d5ec
>
> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/net/vxlan.c?id=56ef9c909b40483d2c8cb63fcbf83865f162d5ec
>
> I am working to verify that that is the culprit but I thought I’d see in the mean time if anyone else has encountered and/or fixed this, or can at least shed more light on the problem.

Yes that commit is the culprit. Previously it was ignoring igmp_join 
errors, and now it's not but at the same time, it's trying to double 
join that group on the socket that is reused.

Will try to cook a patch here, thanks for the report!

If you need a hack for now, just ignore vxlan_igmp_join() return value 
at vxlan_open() and it should be fine.

   Marcelo