From 542189f21b3ea9b27b0fbc047d832a34dcaf75bc Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Wed, 22 Dec 1999 22:11:18 +0000 Subject: [PATCH] dns_result_torcode() now converts ISC_R_SUCCESS into dns_rcode_noerror, not dns_rcode_servfail --- bin/named/notify.c | 5 +---- bin/named/update.c | 3 +-- lib/dns/result.c | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/named/notify.c b/bin/named/notify.c index f47b02ebdc..8fd2008c15 100644 --- a/bin/named/notify.c +++ b/bin/named/notify.c @@ -140,10 +140,7 @@ respond(ns_client_t *client, dns_result_t result) { isc_result_t msg_result; message = client->message; - if (result == DNS_R_SUCCESS) - rcode = dns_rcode_noerror; - else - rcode = dns_result_torcode(result); + rcode = dns_result_torcode(result); msg_result = dns_message_reply(message, ISC_TRUE); if (msg_result != ISC_R_SUCCESS) diff --git a/bin/named/update.c b/bin/named/update.c index 5b678babaf..6067b33ddd 100644 --- a/bin/named/update.c +++ b/bin/named/update.c @@ -1730,8 +1730,7 @@ respond(ns_client_t *client, dns_result_t result) { goto msg_failure; response->id = client->message->id; - response->rcode = (result == DNS_R_SUCCESS ? - dns_rcode_noerror : dns_result_torcode(result)); + response->rcode = dns_result_torcode(result)); response->flags = client->message->flags; response->flags |= DNS_MESSAGEFLAG_QR; response->opcode = client->message->opcode; diff --git a/lib/dns/result.c b/lib/dns/result.c index 71812673ac..30d2bb1cf6 100644 --- a/lib/dns/result.c +++ b/lib/dns/result.c @@ -160,6 +160,9 @@ dns_result_torcode(isc_result_t result) { * Try to supply an appropriate rcode. */ switch (result) { + case ISC_R_SUCCESS: + return rcode = dns_rcode_noerror; + break; case ISC_R_NOSPACE: case ISC_R_UNEXPECTEDEND: case ISC_R_BADBASE64: