Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 May 2021 13:33:01 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3eebc6234b00 - stable/13 - in6_mcast: Return EADDRINUSE when we've already joined the group
Message-ID:  <202105171333.14HDX1JP036777@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=3eebc6234b007e467d58f570e560c08385dd2319

commit 3eebc6234b007e467d58f570e560c08385dd2319
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-05-04 17:23:15 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-05-17 07:50:26 +0000

    in6_mcast: Return EADDRINUSE when we've already joined the group
    
    Distinguish between truly invalid requests and those that fail because
    we've already joined the group. Both cases fail, but differentiating
    them allows userspace to make more informed decisions about what the
    error means.
    
    For example. radvd tries to join the all-routers group on every SIGHUP.
    This fails, because it's already joined it, but this failure should be
    ignored (rather than treated as a sign that the interface's multicast is
    broken).
    
    This puts us in line with OpenBSD, NetBSD and Linux.
    
    Reviewed by:    donner
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D30111
    
    (cherry picked from commit 2ef5d803e3847f56771c107d9517ec560cf318c9)
---
 sys/netinet6/in6_mcast.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c
index 9b04c87d22a0..0744a1178fc7 100644
--- a/sys/netinet6/in6_mcast.c
+++ b/sys/netinet6/in6_mcast.c
@@ -2030,7 +2030,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sopt)
 			 * state at t1, because allocation of a filter
 			 * is atomic with allocation of a membership.
 			 */
-			error = EINVAL;
+			error = EADDRINUSE;
 			goto out_in6p_locked;
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105171333.14HDX1JP036777>