]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: also reply NOTIMP when refusing a query based on RR type 31675/head
authorRonan Pigott <ronan@rjp.ie>
Fri, 8 Mar 2024 21:48:03 +0000 (14:48 -0700)
committerRonan Pigott <ronan@rjp.ie>
Fri, 8 Mar 2024 21:48:03 +0000 (14:48 -0700)
In some cases we refuse a query based on the RR type, mostly old
deprecated types. Let's return NOTIMP in this case, which best
communicates why the query failed.

src/resolve/resolved-dns-stub.c

index 378d55e230221b01b68ed41cde2124ab0c6b76b0..23d4db9cd54badc145dd372f359e12d3226d52c2 100644 (file)
@@ -841,12 +841,16 @@ static void dns_stub_query_complete(DnsQuery *query) {
                 (void) dns_stub_send_reply(q, DNS_RCODE_REFUSED);
                 break;
 
+        case DNS_TRANSACTION_RR_TYPE_UNSUPPORTED:
+                /* This RR Type is not implemented */
+                (void) dns_stub_send_reply(q, DNS_RCODE_NOTIMP);
+                break;
+
         case DNS_TRANSACTION_INVALID_REPLY:
         case DNS_TRANSACTION_ERRNO:
         case DNS_TRANSACTION_ABORTED:
         case DNS_TRANSACTION_DNSSEC_FAILED:
         case DNS_TRANSACTION_NO_TRUST_ANCHOR:
-        case DNS_TRANSACTION_RR_TYPE_UNSUPPORTED:
         case DNS_TRANSACTION_NETWORK_DOWN:
         case DNS_TRANSACTION_NO_SOURCE:
         case DNS_TRANSACTION_STUB_LOOP: