]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: avoid NOTIMP error when looking up not supported requests
authorLennart Poettering <lennart@poettering.net>
Fri, 30 Oct 2020 16:47:43 +0000 (17:47 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 9 Feb 2021 16:58:30 +0000 (17:58 +0100)
Some folks argue that NOTIMP should only be returned if a specific QTYPE
is not supported. While I don#t think the RFCs are too clear about that,
let's use REFUSED instead, which appears to be a less controversial
choice of error code.

Prompted-by: #17218
src/resolve/resolved-dns-stub.c

index 8c252bfafe5af0b0d7c438c6563aae89ec92907f..c54e269927a75aa2832f8554b96da15ca6b4f35f 100644 (file)
@@ -703,13 +703,13 @@ static void dns_stub_process_query(Manager *m, DnsStubListenerExtra *l, DnsStrea
 
         if (dns_type_is_obsolete(p->question->keys[0]->type)) {
                 log_debug("Got message with obsolete key type, refusing.");
-                dns_stub_send_failure(m, l, s, p, DNS_RCODE_NOTIMP, false);
+                dns_stub_send_failure(m, l, s, p, DNS_RCODE_REFUSED, false);
                 return;
         }
 
         if (dns_type_is_zone_transer(p->question->keys[0]->type)) {
                 log_debug("Got request for zone transfer, refusing.");
-                dns_stub_send_failure(m, l, s, p, DNS_RCODE_NOTIMP, false);
+                dns_stub_send_failure(m, l, s, p, DNS_RCODE_REFUSED, false);
                 return;
         }