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

(cherry picked from commit 2ef5d803e3847f56771c107d9517ec560cf318c9)

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
rG9ad87c22530d: service/ipfw: Silence warning on restart
Branches
Unknown
Tags
Unknown