netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: netdev@vger.kernel.org
Cc: John Nielsen <lists@jnielsen.net>
Subject: [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join
Date: Tue, 25 Aug 2015 20:22:35 -0300	[thread overview]
Message-ID: <78f32de72ff150f6a1260f44a409cfed915a17e1.1440544648.git.marcelo.leitner@gmail.com> (raw)
In-Reply-To: <55DCB958.3080904@gmail.com>

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>
---

John, please see how this goes for you. It worked in here.

Dave, please consider this for stable trees. At least 4.1 is affected.

Thanks.

 drivers/net/vxlan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 61b457b9ec00517037e4833790bea97ac53aa832..b0a2da5d4e57e602c915b65abd34a83939c4c473 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2279,6 +2279,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;
-- 
2.4.3

  reply	other threads:[~2015-08-25 23:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 17:35 vxlan regression: multiple VXLANs on a single multicast group broken in kernel 4.1 John Nielsen
2015-08-25 18:52 ` Marcelo Ricardo Leitner
2015-08-25 23:22   ` Marcelo Ricardo Leitner [this message]
2015-08-25 23:25     ` [PATCH net] vxlan: re-ignore EADDRINUSE from igmp_join David Miller
2015-09-01 21:02     ` John Nielsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78f32de72ff150f6a1260f44a409cfed915a17e1.1440544648.git.marcelo.leitner@gmail.com \
    --to=marcelo.leitner@gmail.com \
    --cc=lists@jnielsen.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).