mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 23:55:27 +00:00
make +trace and +nssearch work together
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dig.c,v 1.155 2001/07/28 01:41:28 bwelling Exp $ */
|
/* $Id: dig.c,v 1.156 2001/07/29 23:23:41 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -748,12 +748,6 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
|||||||
ndots = 0;
|
ndots = 0;
|
||||||
break;
|
break;
|
||||||
case 's': /* nssearch */
|
case 's': /* nssearch */
|
||||||
if (lookup->trace && state) {
|
|
||||||
fprintf(stderr,
|
|
||||||
"+trace and +nssearch cannot both be "
|
|
||||||
"specified. Ignoring +nssearch\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
lookup->ns_search_only = state;
|
lookup->ns_search_only = state;
|
||||||
if (state) {
|
if (state) {
|
||||||
lookup->trace_root = ISC_TRUE;
|
lookup->trace_root = ISC_TRUE;
|
||||||
@@ -831,13 +825,6 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
|||||||
case 'r':
|
case 'r':
|
||||||
switch (cmd[2]) {
|
switch (cmd[2]) {
|
||||||
case 'a': /* trace */
|
case 'a': /* trace */
|
||||||
if (lookup->ns_search_only && state) {
|
|
||||||
fprintf(stderr,
|
|
||||||
"+trace and +nssearch cannot "
|
|
||||||
"both be specified. Ignoring "
|
|
||||||
"+trace\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
lookup->trace = state;
|
lookup->trace = state;
|
||||||
lookup->trace_root = state;
|
lookup->trace_root = state;
|
||||||
if (state) {
|
if (state) {
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dighost.c,v 1.217 2001/07/28 00:55:14 bwelling Exp $ */
|
/* $Id: dighost.c,v 1.218 2001/07/29 23:23:42 bwelling Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notice to programmers: Do not use this code as an example of how to
|
* Notice to programmers: Do not use this code as an example of how to
|
||||||
@@ -1052,7 +1052,11 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section)
|
|||||||
lookup = requeue_lookup(query->lookup,
|
lookup = requeue_lookup(query->lookup,
|
||||||
ISC_FALSE);
|
ISC_FALSE);
|
||||||
lookup->doing_xfr = ISC_FALSE;
|
lookup->doing_xfr = ISC_FALSE;
|
||||||
lookup->trace = query->lookup->trace;
|
if (!lookup->trace_root &&
|
||||||
|
section == DNS_SECTION_ANSWER)
|
||||||
|
lookup->trace = ISC_FALSE;
|
||||||
|
else
|
||||||
|
lookup->trace = query->lookup->trace;
|
||||||
lookup->ns_search_only =
|
lookup->ns_search_only =
|
||||||
query->lookup->ns_search_only;
|
query->lookup->ns_search_only;
|
||||||
lookup->trace_root = ISC_FALSE;
|
lookup->trace_root = ISC_FALSE;
|
||||||
@@ -2366,10 +2370,30 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
|||||||
printmessage(query, msg, ISC_TRUE);
|
printmessage(query, msg, ISC_TRUE);
|
||||||
received(b->used, &sevent->address, query);
|
received(b->used, &sevent->address, query);
|
||||||
}
|
}
|
||||||
}
|
} else if (!l->trace && !l->ns_search_only) {
|
||||||
else if (!l->trace && !l->ns_search_only) {
|
|
||||||
printmessage(query, msg, ISC_TRUE);
|
printmessage(query, msg, ISC_TRUE);
|
||||||
} else if (l->ns_search_only) {
|
} else if (l->trace) {
|
||||||
|
int n = 0;
|
||||||
|
int count = msg->counts[DNS_SECTION_ANSWER];
|
||||||
|
|
||||||
|
debug("in TRACE code");
|
||||||
|
if (!l->ns_search_only)
|
||||||
|
printmessage(query, msg, ISC_TRUE);
|
||||||
|
|
||||||
|
l->rdtype = l->qrdtype;
|
||||||
|
if (l->trace_root || (l->ns_search_only && count > 0))
|
||||||
|
{
|
||||||
|
if (!l->trace_root)
|
||||||
|
l->rdtype = dns_rdatatype_soa;
|
||||||
|
n = followup_lookup(msg, query,
|
||||||
|
DNS_SECTION_ANSWER);
|
||||||
|
l->trace_root = ISC_FALSE;
|
||||||
|
} else if (count == 0)
|
||||||
|
n = followup_lookup(msg, query,
|
||||||
|
DNS_SECTION_AUTHORITY);
|
||||||
|
if (n == 0)
|
||||||
|
docancel = ISC_TRUE;
|
||||||
|
} else {
|
||||||
debug("in NSSEARCH code");
|
debug("in NSSEARCH code");
|
||||||
|
|
||||||
if (l->trace_root) {
|
if (l->trace_root) {
|
||||||
@@ -2378,36 +2402,16 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
|||||||
*/
|
*/
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
l->trace_root = ISC_FALSE;
|
|
||||||
l->rdtype = dns_rdatatype_soa;
|
l->rdtype = dns_rdatatype_soa;
|
||||||
n = followup_lookup(msg, query,
|
n = followup_lookup(msg, query,
|
||||||
DNS_SECTION_ANSWER);
|
DNS_SECTION_ANSWER);
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
docancel = ISC_TRUE;
|
docancel = ISC_TRUE;
|
||||||
|
l->trace_root = ISC_FALSE;
|
||||||
} else
|
} else
|
||||||
printmessage(query, msg, ISC_TRUE);
|
printmessage(query, msg, ISC_TRUE);
|
||||||
} else {
|
|
||||||
int n = 0;
|
|
||||||
int count = msg->counts[DNS_SECTION_ANSWER];
|
|
||||||
|
|
||||||
debug("in TRACE code");
|
|
||||||
printmessage(query, msg, ISC_TRUE);
|
|
||||||
|
|
||||||
l->rdtype = l->qrdtype;
|
|
||||||
if (l->trace_root) {
|
|
||||||
l->trace_root = ISC_FALSE;
|
|
||||||
n = followup_lookup(msg, query,
|
|
||||||
DNS_SECTION_ANSWER);
|
|
||||||
} else if (count == 0)
|
|
||||||
n = followup_lookup(msg, query,
|
|
||||||
DNS_SECTION_AUTHORITY);
|
|
||||||
if (n == 0)
|
|
||||||
docancel = ISC_TRUE;
|
|
||||||
}
|
}
|
||||||
} else if (msg->counts[DNS_SECTION_ANSWER] > 0 &&
|
}
|
||||||
l->ns_search_only &&
|
|
||||||
!l->trace_root)
|
|
||||||
printmessage(query, msg, ISC_TRUE);
|
|
||||||
|
|
||||||
if (l->pending)
|
if (l->pending)
|
||||||
debug("still pending.");
|
debug("still pending.");
|
||||||
|
Reference in New Issue
Block a user