2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 07:35:26 +00:00

1917. [func] dig now warns if 'RA' is not set in the answer when

'RD' was set in the query.  host/nslookup skip servers
                        that fail to set 'RA' when 'RD' is set unless a server
                        is explicitly set.  [RT #15005]
This commit is contained in:
Mark Andrews
2005-08-25 00:40:50 +00:00
parent 3d711f2f75
commit 715361d0c3
6 changed files with 37 additions and 15 deletions

View File

@@ -1,3 +1,8 @@
1917. [func] dig now warns if 'RA' is not set in the answer when
'RD' was set in the query. host/nslookup skip servers
that fail to set 'RA' when 'RD' is set unless a server
is explicitly set. [RT #15005]
1916. [func] host/nslookup now continue (default)/fail on SERVFAIL. 1916. [func] host/nslookup now continue (default)/fail on SERVFAIL.
[RT #15006] [RT #15006]

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dig.c,v 1.206 2005/08/25 00:17:45 marka Exp $ */ /* $Id: dig.c,v 1.207 2005/08/25 00:40:49 marka Exp $ */
/*! \file */ /*! \file */
@@ -490,6 +490,11 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
msg->counts[DNS_SECTION_ANSWER], msg->counts[DNS_SECTION_ANSWER],
msg->counts[DNS_SECTION_AUTHORITY], msg->counts[DNS_SECTION_AUTHORITY],
msg->counts[DNS_SECTION_ADDITIONAL]); msg->counts[DNS_SECTION_ADDITIONAL]);
if ((msg->flags & DNS_MESSAGEFLAG_RD) != 0 &&
(msg->flags & DNS_MESSAGEFLAG_RA) == 0)
printf(";; WARNING: recusion requested "
"but not available\n");
} }
if (msg != query->lookup->sendmsg && extrabytes != 0U) if (msg != query->lookup->sendmsg && extrabytes != 0U)
printf(";; WARNING: Messages has %u extra byte%s at " printf(";; WARNING: Messages has %u extra byte%s at "

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dighost.c,v 1.281 2005/08/25 00:17:46 marka Exp $ */ /* $Id: dighost.c,v 1.282 2005/08/25 00:40:49 marka Exp $ */
/*! \file /*! \file
* \note * \note
@@ -96,6 +96,7 @@ dig_serverlist_t server_list;
dig_searchlistlist_t search_list; dig_searchlistlist_t search_list;
isc_boolean_t isc_boolean_t
check_ra = ISC_FALSE,
have_ipv4 = ISC_FALSE, have_ipv4 = ISC_FALSE,
have_ipv6 = ISC_FALSE, have_ipv6 = ISC_FALSE,
specified_source = ISC_FALSE, specified_source = ISC_FALSE,
@@ -2796,8 +2797,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
UNLOCK_LOOKUP; UNLOCK_LOOKUP;
return; return;
} }
if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0 if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0 &&
&& !l->ignore && !l->tcp_mode) { !l->ignore && !l->tcp_mode) {
printf(";; Truncated, retrying in TCP mode.\n"); printf(";; Truncated, retrying in TCP mode.\n");
n = requeue_lookup(l, ISC_TRUE); n = requeue_lookup(l, ISC_TRUE);
n->tcp_mode = ISC_TRUE; n->tcp_mode = ISC_TRUE;
@@ -2810,7 +2811,9 @@ recv_done(isc_task_t *task, isc_event_t *event) {
UNLOCK_LOOKUP; UNLOCK_LOOKUP;
return; return;
} }
if (msg->rcode == dns_rcode_servfail && !l->servfail_stops) { if ((msg->rcode == dns_rcode_servfail && !l->servfail_stops) ||
(check_ra && (msg->flags & DNS_MESSAGEFLAG_RA) == 0 && l->recurse))
{
dig_query_t *next = ISC_LIST_NEXT(query, link); dig_query_t *next = ISC_LIST_NEXT(query, link);
if (l->current_query == query) if (l->current_query == query)
l->current_query = NULL; l->current_query = NULL;
@@ -2828,9 +2831,13 @@ recv_done(isc_task_t *task, isc_event_t *event) {
*/ */
if ((ISC_LIST_HEAD(l->q) != query) || if ((ISC_LIST_HEAD(l->q) != query) ||
(ISC_LIST_NEXT(query, link) != NULL)) { (ISC_LIST_NEXT(query, link) != NULL)) {
printf(";; Got SERVFAIL reply from %s, " if( l->comments == ISC_TRUE )
"trying next server\n", printf(";; Got %s from %s, "
query->servname); "trying next server\n",
msg->rcode == dns_rcode_servfail ?
"SERVFAIL reply" :
"recursion not available",
query->servname);
clear_query(query); clear_query(query);
check_next_lookup(l); check_next_lookup(l);
dns_message_destroy(&msg); dns_message_destroy(&msg);

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: host.c,v 1.105 2005/08/25 00:31:31 marka Exp $ */ /* $Id: host.c,v 1.106 2005/08/25 00:40:49 marka Exp $ */
/*! \file */ /*! \file */
@@ -748,7 +748,8 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
set_nameserver(argv[isc_commandline_index+1]); set_nameserver(argv[isc_commandline_index+1]);
debug("server is %s", argv[isc_commandline_index+1]); debug("server is %s", argv[isc_commandline_index+1]);
listed_server = ISC_TRUE; listed_server = ISC_TRUE;
} } else
check_ra = ISC_TRUE;
lookup->pending = ISC_FALSE; lookup->pending = ISC_FALSE;
if (get_reverse(store, sizeof(store), hostname, if (get_reverse(store, sizeof(store), hostname,

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dig.h,v 1.95 2005/08/25 00:17:46 marka Exp $ */ /* $Id: dig.h,v 1.96 2005/08/25 00:40:50 marka Exp $ */
#ifndef DIG_H #ifndef DIG_H
#define DIG_H #define DIG_H
@@ -243,7 +243,7 @@ extern dig_serverlist_t server_list;
extern dig_searchlistlist_t search_list; extern dig_searchlistlist_t search_list;
extern unsigned int extrabytes; extern unsigned int extrabytes;
extern isc_boolean_t have_ipv4, have_ipv6, specified_source, extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source,
usesearch, showsearch, qr; usesearch, showsearch, qr;
extern in_port_t port; extern in_port_t port;
extern unsigned int timeout; extern unsigned int timeout;

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: nslookup.c,v 1.110 2005/08/25 00:31:32 marka Exp $ */ /* $Id: nslookup.c,v 1.111 2005/08/25 00:40:50 marka Exp $ */
#include <config.h> #include <config.h>
@@ -734,6 +734,7 @@ get_next_command(void) {
(strcasecmp(ptr, "lserver") == 0)) { (strcasecmp(ptr, "lserver") == 0)) {
isc_app_block(); isc_app_block();
set_nameserver(arg); set_nameserver(arg);
check_ra = ISC_FALSE;
isc_app_unblock(); isc_app_unblock();
show_settings(ISC_TRUE, ISC_TRUE); show_settings(ISC_TRUE, ISC_TRUE);
} else if (strcasecmp(ptr, "exit") == 0) { } else if (strcasecmp(ptr, "exit") == 0) {
@@ -772,9 +773,10 @@ parse_args(int argc, char **argv) {
have_lookup = ISC_TRUE; have_lookup = ISC_TRUE;
in_use = ISC_TRUE; in_use = ISC_TRUE;
addlookup(argv[0]); addlookup(argv[0]);
} } else {
else
set_nameserver(argv[0]); set_nameserver(argv[0]);
check_ra = ISC_FALSE;
}
} }
} }
} }
@@ -850,6 +852,8 @@ main(int argc, char **argv) {
ISC_LIST_INIT(server_list); ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list); ISC_LIST_INIT(search_list);
check_ra = ISC_TRUE;
result = isc_app_start(); result = isc_app_start();
check_result(result, "isc_app_start"); check_result(result, "isc_app_start");