add a result code for ENOPROTOOPT, EPROTONOSUPPORT

there was no isc_result_t value for invalid protocol errors
that could be returned from libuv.

(cherry picked from commit 0393b54afb)
This commit is contained in:
Evan Hunt 2023-04-05 14:05:46 -07:00 committed by Ondřej Surý
parent cdff6bb8ba
commit 2a714c25f8
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41
3 changed files with 9 additions and 5 deletions

View file

@ -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,

View file

@ -90,13 +90,15 @@ isc___nm_uverr2result(int uverr, bool dolog, const char *file,
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);
}

View file

@ -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",