From owner-dev-commits-src-branches@freebsd.org Mon May 17 13:33:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFD4664853D; Mon, 17 May 2021 13:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FkKnn6XY3z4tQB; Mon, 17 May 2021 13:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C87E04D5E; Mon, 17 May 2021 13:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14HDX1gm036778; Mon, 17 May 2021 13:33:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14HDX1JP036777; Mon, 17 May 2021 13:33:01 GMT (envelope-from git) Date: Mon, 17 May 2021 13:33:01 GMT Message-Id: <202105171333.14HDX1JP036777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 3eebc6234b00 - stable/13 - in6_mcast: Return EADDRINUSE when we've already joined the group MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3eebc6234b007e467d58f570e560c08385dd2319 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2021 13:33:02 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3eebc6234b007e467d58f570e560c08385dd2319 commit 3eebc6234b007e467d58f570e560c08385dd2319 Author: Kristof Provost AuthorDate: 2021-05-04 17:23:15 +0000 Commit: Kristof Provost 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; } }