"Todd C. Miller" <[email protected]> writes: > On Fri, 05 Feb 2016 17:17:30 +0100, Martin Pieuchot wrote: > >> > > We could also return ENOBUFS in this case instead. That would >> > > correspond to the errors described in ip(4) (sadly setsockopt(2) is not >> > > really reflecting the code). >> > > >> > > Jérémie what other OSes report as errors for IP_ADD_MEMBERSHIP? >> > >> > I only looked at loonix-4.5-rc2 so far: ENOBUFS in this error case. >> >> Then I think it's the way to go. > > Works for me.
Hmm, FreeBSD and NetBSD still return ETOOMANYREFS in such a situation. But the only piece of software out there that seems to actively check for ETOOMANYREFS is D-Bus. Not relevant here since multicast isn't involved. (https://bugs.freedesktop.org/show_bug.cgi?id=80163) ok? Index: sys/netinet/ip_output.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_output.c,v retrieving revision 1.317 diff -u -p -r1.317 ip_output.c --- sys/netinet/ip_output.c 21 Jan 2016 11:23:48 -0000 1.317 +++ sys/netinet/ip_output.c 5 Feb 2016 17:46:08 -0000 @@ -1496,7 +1496,7 @@ ip_setmoptions(int optname, struct ip_mo } } if (nmships == NULL) { - error = ETOOMANYREFS; + error = ENOBUFS; if_put(ifp); break; } -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
