]> git.ipfire.org Git - thirdparty/bind9.git/commit
Refactor how we map isc_result_t <-> dns_rcode_t
authorOndřej Surý <ondrej@isc.org>
Thu, 15 Jun 2023 08:24:21 +0000 (10:24 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 15 Jun 2023 13:32:04 +0000 (15:32 +0200)
commitb53d1d7069d7fd9fc71d94d0cced572ac6574f3f
treeb4367e626af8655d56daa3b6ab1e160090d499cc
parent189aadbab9edb8b25e357eec35618573753f185a
Refactor how we map isc_result_t <-> dns_rcode_t

The mapping functions between isc_result_t and dns_rcode_t could return
both isc_result_t values not defined in the header and dns_rcode_t
values not defined in the header because it blindly maps anything
withing full 12-bits defined for RCODEs to isc_result_t and back.

Refactor the dns_result_{from,to}rcode() functions to always return
valid isc_result_t and dns_rcode_t values by explicitly mapping the
values to each other and returning DNS_R_SERVFAIL (dns_rcode_servfail)
when encountering value out of the defined range.
lib/dns/result.c