From 17747cd5ee98901b435cd2b3019c52937955a981 Mon Sep 17 00:00:00 2001 From: Michael Sawyer Date: Wed, 24 May 2000 19:49:51 +0000 Subject: [PATCH] Clean up warnings I accidentally left in in previous commit. Add resetting of lookup counter between different name searches. --- bin/dig/dig.c | 12 +++++++----- bin/dig/dighost.c | 3 +++ bin/dig/host.c | 1 + bin/dig/include/dig/dig.h | 3 ++- bin/dig/nslookup.c | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 0fc3cac7ab..92e691e9b2 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -203,9 +203,8 @@ trying(int frmsize, char *frm, dig_lookup_t *lookup) { } -isc_result_t +static isc_result_t say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) { - isc_region_t r, r2; isc_result_t result; isc_uint64_t diff; isc_time_t now; @@ -233,7 +232,7 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) { return (ISC_R_SUCCESS); } -isc_result_t +static isc_result_t short_answer(dns_message_t *msg, dns_messagetextflag_t flags, isc_buffer_t *buf, dig_query_t *query) { @@ -241,13 +240,13 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, dns_rdataset_t *rdataset; isc_buffer_t target; isc_result_t result, loopresult; - isc_region_t r; dns_name_t empty_name; char t[4096]; isc_boolean_t first; - isc_boolean_t no_rdata; dns_rdata_t rdata; + UNUSED (flags); + dns_name_init(&empty_name, NULL); result = dns_message_firstname(msg, DNS_SECTION_ANSWER); if (result == ISC_R_NOMORE) @@ -962,6 +961,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { lookup->section_answer = section_answer; lookup->section_authority = section_authority; lookup->section_additional = section_additional; + lookup->new_search = ISC_TRUE; ISC_LIST_INIT(lookup->q); lookup->origin = NULL; ISC_LIST_INIT(lookup->my_server_list); @@ -1019,6 +1019,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { lookup->section_answer = section_answer; lookup->section_authority = section_authority; lookup->section_additional = section_additional; + lookup->new_search = ISC_TRUE; ISC_LIST_INIT(lookup->q); ISC_LIST_APPEND(lookup_list, lookup, link); lookup->origin = NULL; @@ -1086,6 +1087,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { lookup->section_answer = section_answer; lookup->section_authority = section_authority; lookup->section_additional = section_additional; + lookup->new_search = ISC_TRUE; ISC_LIST_INIT(lookup->q); ISC_LIST_INIT(lookup->my_server_list); strcpy(lookup->textname, "."); diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index ca1c25652e..8eeca38d3f 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -276,6 +276,7 @@ dig_lookup_t looknew->section_answer = lookold->section_answer; looknew->section_authority = lookold->section_authority; looknew->section_additional = lookold->section_additional; + looknew->new_search = ISC_FALSE; ISC_LIST_INIT(looknew->my_server_list); ISC_LIST_INIT(looknew->q); @@ -764,6 +765,8 @@ setup_lookup(dig_lookup_t *lookup) { &lookup->sendmsg); check_result(result, "dns_message_create"); + if (lookup->new_search) + lookup_counter = 0; result = dns_message_gettempname(lookup->sendmsg, &lookup->name); check_result(result, "dns_message_gettempname"); diff --git a/bin/dig/host.c b/bin/dig/host.c index 31d8f8d826..d0cd0967c1 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -673,6 +673,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { lookup->trace = showallsoa; lookup->trace_root = ISC_FALSE; lookup->tcp_mode = tcpmode; + lookup->new_search = ISC_TRUE; ISC_LIST_INIT(lookup->q); ISC_LIST_APPEND(lookup_list, lookup, link); lookup->origin = NULL; diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h index b89df65606..6d9b061d5f 100644 --- a/bin/dig/include/dig/dig.h +++ b/bin/dig/include/dig/dig.h @@ -74,7 +74,8 @@ struct dig_lookup { section_question, section_answer, section_authority, - section_additional; + section_additional, + new_search; char textname[MXNAME]; /* Name we're going to be looking up */ char rttext[MXRD]; /* rdata type text */ char rctext[MXRD]; /* rdata class text */ diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 2a94160dbf..108012abf1 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -665,6 +665,7 @@ addlookup(char *opt) { lookup->section_answer = section_answer; lookup->section_authority = section_authority; lookup->section_additional = section_additional; + lookup->new_search = ISC_TRUE; ISC_LIST_INIT(lookup->q); ISC_LIST_APPEND(lookup_list, lookup, link); lookup->origin = NULL;