git: 2ef5d803e384 - main - in6_mcast: Return EADDRINUSE when we've already joined the group
Kristof Provost
kp at FreeBSD.org
Mon May 10 14:11:26 UTC 2021
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=2ef5d803e3847f56771c107d9517ec560cf318c9
commit 2ef5d803e3847f56771c107d9517ec560cf318c9
Author: Kristof Provost <kp at FreeBSD.org>
AuthorDate: 2021-05-04 17:23:15 +0000
Commit: Kristof Provost <kp at FreeBSD.org>
CommitDate: 2021-05-10 07:48:51 +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
---
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;
}
}
More information about the dev-commits-src-main
mailing list