HomeFreeBSD

in6_mcast: Return EADDRINUSE when we've already joined the group

Description

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

Details

Provenance
kpAuthored on May 4 2021, 5:23 PM
Reviewer
donner
Differential Revision
D30111: in6_mcast: Return EADDRINUSE when we've already joined the group
Parents
rG8725f0b9dbd2: Revert "getty: push assignment to inner block."
Branches
Unknown
Tags
Unknown