Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
722ebc3a
Commit
722ebc3a
authored
Oct 07, 2004
by
Mark Andrews
Browse files
1715. [func] 'dig +trace' now randomly selects the next servers
to try. Report if there is a bad delegation.
parent
207f0a15
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
722ebc3a
...
...
@@ -64,7 +64,8 @@
1716. [doc] named.conf(5) was being installed in the wrong
location. [RT# 12441]
1715. [placeholder] rt11681
1715. [func] 'dig +trace' now randomly selects the next servers
to try. Report if there is a bad delegation.
1714. [bug] dig/host/nslookup were only trying the first
address when a nameserver was specified by name.
...
...
bin/dig/dighost.c
View file @
722ebc3a
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.2
69
2004/10/0
5
0
3:0
1:4
7
marka Exp $ */
/* $Id: dighost.c,v 1.2
70
2004/10/0
7
0
2:2
1:4
8
marka Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
...
...
@@ -1405,6 +1405,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section)
isc_result_t
result
;
isc_boolean_t
success
=
ISC_FALSE
;
int
numLookups
=
0
;
dns_name_t
*
domain
;
INSIST
(
!
free_now
);
...
...
@@ -1431,6 +1432,20 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section)
debug
(
"found NS set"
);
if
(
query
->
lookup
->
trace
&&
!
query
->
lookup
->
trace_root
)
{
dns_namereln_t
namereln
;
unsigned
int
nlabels
;
int
order
;
domain
=
dns_fixedname_name
(
&
query
->
lookup
->
fdomain
);
namereln
=
dns_name_fullcompare
(
name
,
domain
,
&
order
,
&
nlabels
);
if
(
namereln
==
dns_namereln_equal
)
printf
(
";; BAD (HORIZONTAL) REFERRAL
\n
"
);
else
if
(
namereln
!=
dns_namereln_subdomain
)
printf
(
";; BAD REFERRAL
\n
"
);
}
for
(
result
=
dns_rdataset_first
(
rdataset
);
result
==
ISC_R_SUCCESS
;
result
=
dns_rdataset_next
(
rdataset
))
{
...
...
@@ -1466,6 +1481,9 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section)
lookup
->
ns_search_only
=
query
->
lookup
->
ns_search_only
;
lookup
->
trace_root
=
ISC_FALSE
;
dns_fixedname_init
(
&
lookup
->
fdomain
);
domain
=
dns_fixedname_name
(
&
lookup
->
fdomain
);
dns_name_copy
(
name
,
domain
,
NULL
);
}
srv
=
make_server
(
namestr
,
namestr
);
debug
(
"adding server %s"
,
srv
->
servername
);
...
...
@@ -1479,7 +1497,29 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section)
(
query
->
lookup
->
trace
||
query
->
lookup
->
ns_search_only
))
return
(
followup_lookup
(
msg
,
query
,
DNS_SECTION_AUTHORITY
));
return
numLookups
;
/*
* Randomize the order the nameserver will be tried.
*/
if
(
numLookups
>
1
)
{
isc_uint32_t
i
,
j
;
dig_serverlist_t
my_server_list
;
ISC_LIST_INIT
(
my_server_list
);
for
(
i
=
numLookups
;
i
>
0
;
i
--
)
{
isc_random_get
(
&
j
);
j
%=
i
;
srv
=
ISC_LIST_HEAD
(
lookup
->
my_server_list
);
while
(
j
--
>
0
)
srv
=
ISC_LIST_NEXT
(
srv
,
link
);
ISC_LIST_DEQUEUE
(
lookup
->
my_server_list
,
srv
,
link
);
ISC_LIST_APPEND
(
my_server_list
,
srv
,
link
);
}
ISC_LIST_APPENDLIST
(
lookup
->
my_server_list
,
my_server_list
,
link
);
}
return
(
numLookups
);
}
/*
...
...
bin/dig/include/dig/dig.h
View file @
722ebc3a
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.h,v 1.8
6
2004/0
9
/0
6
0
1
:2
4
:4
4
marka Exp $ */
/* $Id: dig.h,v 1.8
7
2004/
1
0/0
7
0
2
:2
1
:4
8
marka Exp $ */
#ifndef DIG_H
#define DIG_H
...
...
@@ -176,6 +176,7 @@ isc_boolean_t sigchase;
dst_context_t
*
tsigctx
;
isc_buffer_t
*
querysig
;
isc_uint32_t
msgcounter
;
dns_fixedname_t
fdomain
;
};
struct
dig_query
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment