SO_BSDCOMPAT MESSAGE

Stefan Puiu stefan.puiu at gmail.com
Thu Nov 17 12:20:17 UTC 2005


Mark, just curious, did you complain about this to any of the Linux
developers? Over time I saw you making complaints about various glitches of
that OS/kernel, and was wondering if there's anybody in the Linux camp made
aware of these things.
I doubt it that users would dare bring issues like this one on, say, the
linux-kernel mailing list.

On 11/17/05, Mark Andrews <Mark_Andrews at isc.org> wrote:
>
>
> Complain to the Linux kernel developers. They should remove
> the message or the #define.
>
> I suspect that all usage instances are actually protected
> with a #ifdef SO_BSDCOMPAT because it is not in early versions
> of the kernel.
>
> e.g.
>
> #ifdef SO_BSDCOMPAT
> if (type != isc_sockettype_unix &&
> setsockopt(sock->fd, SOL_SOCKET, SO_BSDCOMPAT,
> (void *)&on, sizeof(on)) < 0) {
> isc__strerror(errno, strbuf, sizeof(strbuf));
> UNEXPECTED_ERROR(__FILE__, __LINE__,
> "setsockopt(%d, SO_BSDCOMPAT) %s: %s",
> sock->fd,
> isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
> ISC_MSG_FAILED, "failed"),
> strbuf);
> /* Press on... */
> }
> #endif
>
> Do they really expect application developers to try to
> workout what kernel version is running to see if they need
> to set SO_BSDCOMPAT especially when some kernel versions
> need the option turned on?
>
> As to why it was that the Linux kernel developers thought
> that making unconnected UDP sockets return errors after
> getting a ICMP message would be good. Unfortunately this
> is only really useful in the case where a connected UDP
> socket could be used (always talking to the same end point).
> There is not enough information to do anything with the
> error code when you are talking to thousands of different
> clients a second.
>
> They then came up with this socket option to restore the
> BSD Socket API behaviour (SO_BSDCOMPAT) and not pass the
> error information back up the stack.
>
> They then decided to change the default to be the BSD Socket
> API behaviour so the setsockopt(SO_BSDCOMPAT) call was no
> longer necessary and decided to make the kernel complain
> about all such calls but also did not remove the #define for
> SO_BSDCOMPAT.
>
> Mark
> --
> Mark Andrews, ISC
> 1 Seymour St., Dundas Valley, NSW 2117, Australia
> PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews at isc.org
>
>
>



More information about the bind-users mailing list