]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Fri, 12 Oct 2001 19:14:47 +0000 (19:14 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 12 Oct 2001 19:14:47 +0000 (19:14 +0000)
1033.   [bug]           Always respond to requests with an unsupported opcode
                        with NOTIMP, even if we don't have a matching view
                        or cannot determine the class.

CHANGES
bin/named/client.c

diff --git a/CHANGES b/CHANGES
index 4069c114d22ca63db303e708f3f6f49564ca0b1a..4bda22bdc55a45f9f9a288d69ca31627db424a86 100644 (file)
--- a/CHANGES
+++ b/CHANGES
                        TKEY queries with an owner name other than the root
                        could cause an assertion failure. [RT #1866, #1869]
 
+1033.  [bug]           Always respond to requests with an unsupported opcode
+                       with NOTIMP, even if we don't have a matching view
+                       or cannot determine the class.
+
        --- 9.2.0rc6 released ---
 
 1031.  [bug]           libbind.a: isc__gettimeofday() infinite recursion.
index 98e3659008d9f9d22a6aa2deb96d460284c697ce..5ef2959034d73ea1a52ea3978fb1081270abae69 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: client.c,v 1.176.2.3 2001/10/12 18:20:14 gson Exp $ */
+/* $Id: client.c,v 1.176.2.4 2001/10/12 19:14:47 gson Exp $ */
 
 #include <config.h>
 
@@ -1223,6 +1223,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
        int match;
        dns_messageid_t id;
        unsigned int flags;
+       isc_boolean_t notimp;
 
        REQUIRE(event != NULL);
        client = event->ev_arg;
@@ -1370,6 +1371,18 @@ client_request(isc_task_t *task, isc_event_t *event) {
                goto cleanup;
        }
 
+       switch (client->message->opcode) {
+       case dns_opcode_query:
+       case dns_opcode_update:
+       case dns_opcode_notify:
+               notimp = ISC_FALSE;
+               break;
+       case dns_opcode_iquery:
+       default:
+               notimp = ISC_TRUE;
+               break;
+       }
+
        client->message->rcode = dns_rcode_noerror;
 
        /*
@@ -1441,7 +1454,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
                              "message class could not be determined");
                ns_client_dumpmessage(client,
                                      "message class could not be determined");
-               ns_client_error(client, DNS_R_FORMERR);
+               ns_client_error(client, notimp ? DNS_R_NOTIMP : DNS_R_FORMERR);
                goto cleanup;
        }
 
@@ -1490,7 +1503,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
                              NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(1),
                              "no matching view in class '%s'", classname);
                ns_client_dumpmessage(client, "no matching view in class");
-               ns_client_error(client, DNS_R_REFUSED);
+               ns_client_error(client, notimp ? DNS_R_NOTIMP : DNS_R_REFUSED);
                goto cleanup;
        }