From d5169236b7260d447e672db8256fdd7c70f5ee1d Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 9 Oct 2001 02:05:55 +0000 Subject: [PATCH] 1033. [bug] Don't imply that we support a opcode that we don't when we don't have a matching view or cannot determine the class. --- CHANGES | 4 ++++ bin/named/client.c | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index da4690002a..5ed40e7fd0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1033. [bug] Don't imply that we support a opcode that we don't + when we don't have a matching view or cannot + determine the class. + 1032. [func] hostname.bind/txt/chaos now returns the name of the machine hosting the nameserver. This is useful in diagnosing problems with anycast servers. diff --git a/bin/named/client.c b/bin/named/client.c index b051023779..fb3bc80926 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.c,v 1.179 2001/10/01 18:53:56 gson Exp $ */ +/* $Id: client.c,v 1.180 2001/10/09 02:05:55 marka Exp $ */ #include @@ -1061,6 +1061,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; @@ -1208,6 +1209,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; /* @@ -1261,7 +1274,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; } @@ -1310,7 +1323,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; }