From: Ondřej Surý Date: Wed, 26 Aug 2020 14:31:13 +0000 (+0200) Subject: Handle EPROTO errno from recvmsg X-Git-Tag: v9.17.5~25^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0380d437d044c1f665b1014a0d4bf3972e9c139;p=thirdparty%2Fbind9.git Handle EPROTO errno from recvmsg It was discovered, that some systems might set EPROTO instead of EACCESS on recvmsg() call causing spurious syslog messages from the socket code. This commit returns soft handling of EPROTO errno code to the socket code. [GL #1928] --- diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 043b33e34df..731cb60eefd 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -1526,6 +1526,16 @@ doio_recv(isc__socket_t *sock, isc_socketevent_t *dev) { SOFT_OR_HARD(EHOSTUNREACH, ISC_R_HOSTUNREACH); SOFT_OR_HARD(EHOSTDOWN, ISC_R_HOSTDOWN); SOFT_OR_HARD(ENOBUFS, ISC_R_NORESOURCES); + /* + * Older operating systems may still return EPROTO in some + * situations, for example when receiving ICMP/ICMPv6 errors. + * A real life scenario is when ICMPv6 returns code 5 or 6. + * These codes are introduced in RFC 4443 from March 2006, + * and the document obsoletes RFC 1885. But unfortunately not + * all operating systems have caught up with the new standard + * (in 2020) and thus a generic protocol error is returned. + */ + SOFT_OR_HARD(EPROTO, ISC_R_HOSTUNREACH); /* Should never get this one but it was seen. */ #ifdef ENOPROTOOPT SOFT_OR_HARD(ENOPROTOOPT, ISC_R_HOSTUNREACH);