vxlan: re-ignore EADDRINUSE from igmp_join
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Tue, 25 Aug 2015 23:22:35 +0000 (20:22 -0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Aug 2015 23:24:35 +0000 (16:24 -0700)
Before 56ef9c909b40[1] it used to ignore all errors from igmp_join().
That commit enhanced that and made it error out whatever error happened
with igmp_join(), but that's not good because when using multicast
groups vxlan will try to join it multiple times if the socket is reused
and then the 2nd and further attempts will fail with EADDRINUSE.

As we don't track to which groups the socket is already subscribed, it's
okay to just ignore that error.

Fixes: 56ef9c909b40 ("vxlan: Move socket initialization to within rtnl scope")
Reported-by: John Nielsen <lists@jnielsen.net>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c

index 34c519eb1db5092a6e1bd17e02b9a3e53a5c5cb2..5bc4b1ed67b39fa6761abb4027191bcd4977ccaa 100644 (file)
@@ -2216,6 +2216,8 @@ static int vxlan_open(struct net_device *dev)
 
        if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip)) {
                ret = vxlan_igmp_join(vxlan);
+               if (ret == -EADDRINUSE)
+                       ret = 0;
                if (ret) {
                        vxlan_sock_release(vs);
                        return ret;
This page took 0.02822 seconds and 5 git commands to generate.