From: Evan Hunt Date: Wed, 5 Apr 2023 21:05:46 +0000 (-0700) Subject: add a result code for ENOPROTOOPT, EPROTONOSUPPORT X-Git-Tag: v9.19.13~20^2~2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=0393b54afbe1c4e08691698b05442d0db8b31a4b;p=thirdparty%2Fbind9.git add a result code for ENOPROTOOPT, EPROTONOSUPPORT there was no isc_result_t value for invalid protocol errors that could be returned from libuv. --- diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h index ac7273ce521..215c83aba33 100644 --- a/lib/isc/include/isc/result.h +++ b/lib/isc/include/isc/result.h @@ -95,6 +95,7 @@ typedef enum isc_result { ISC_R_TLSBADPEERCERT, /*%< TLS peer certificate verification failed */ ISC_R_HTTP2ALPNERROR, /*%< ALPN for HTTP/2 failed */ ISC_R_DOTALPNERROR, /*%< ALPN for DoT failed */ + ISC_R_INVALIDPROTO, /*%< invalid protocol */ DNS_R_LABELTOOLONG = 1 << 16, DNS_R_BADESCAPE, diff --git a/lib/isc/result.c b/lib/isc/result.c index b41f760fa45..ac55e0bd46f 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -94,6 +94,7 @@ static const char *description[ISC_R_NRESULTS] = { [ISC_R_TLSBADPEERCERT] = "TLS peer certificate verification failed", [ISC_R_HTTP2ALPNERROR] = "ALPN for HTTP/2 failed", [ISC_R_DOTALPNERROR] = "ALPN for DoT failed", + [ISC_R_INVALIDPROTO] = "invalid protocol", [DNS_R_LABELTOOLONG] = "label too long", [DNS_R_BADESCAPE] = "bad escape", diff --git a/lib/isc/uv.c b/lib/isc/uv.c index 79c43624798..8b1ef7398e0 100644 --- a/lib/isc/uv.c +++ b/lib/isc/uv.c @@ -87,13 +87,15 @@ isc__uverr2result(int uverr, bool dolog, const char *file, unsigned int line, return (ISC_R_MAXSIZE); case UV_ENOTSUP: return (ISC_R_FAMILYNOSUPPORT); + case UV_ENOPROTOOPT: + case UV_EPROTONOSUPPORT: + return (ISC_R_INVALIDPROTO); default: if (dolog) { - UNEXPECTED_ERROR( - file, line, - "unable to convert libuv " - "error code in %s to isc_result: %d: %s", - func, uverr, uv_strerror(uverr)); + UNEXPECTED_ERROR("unable to convert libuv error code " + "in %s (%s:%d) to isc_result: %d: %s", + func, file, line, uverr, + uv_strerror(uverr)); } return (ISC_R_UNEXPECTED); }