2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 08:05:21 +00:00

Added +unexpected option so dig will print replies from unexpected

sources.
This commit is contained in:
Diego dos Santos Fronza
2019-07-25 11:35:36 -03:00
parent 582ba39bb6
commit 460d4d63ee
3 changed files with 27 additions and 4 deletions

View File

@@ -235,6 +235,8 @@ help(void) {
" +tries=### (Set number of UDP attempts) [3]\n" " +tries=### (Set number of UDP attempts) [3]\n"
" +[no]ttlid (Control display of ttls in records)\n" " +[no]ttlid (Control display of ttls in records)\n"
" +[no]ttlunits (Display TTLs in human-readable units)\n" " +[no]ttlunits (Display TTLs in human-readable units)\n"
" +[no]unexpected (Print replies from unexpected sources\n"
" default=off)\n"
" +[no]unknownformat (Print RDATA in RFC 3597 \"unknown\" " " +[no]unknownformat (Print RDATA in RFC 3597 \"unknown\" "
"format)\n" "format)\n"
" +[no]vc (TCP mode (+[no]tcp))\n" " +[no]vc (TCP mode (+[no]tcp))\n"
@@ -1667,8 +1669,25 @@ plus_option(char *option, bool is_batchfile,
} }
break; break;
case 'u': case 'u':
FULLCHECK("unknownformat"); switch (cmd[1]) {
lookup->print_unknown_format = state; case 'n':
switch (cmd[2]) {
case 'e':
FULLCHECK("unexpected");
lookup->accept_reply_unexpected_src = true;
break;
case 'k':
FULLCHECK("unknownformat");
lookup->print_unknown_format = state;
break;
default:
goto invalid_option;
}
break;
default:
goto invalid_option;
}
break; break;
case 'v': case 'v':
FULLCHECK("vc"); FULLCHECK("vc");

View File

@@ -3602,7 +3602,9 @@ recv_done(isc_task_t *task, isc_event_t *event) {
sizeof(buf2)); sizeof(buf2));
printf(";; reply from unexpected source: %s," printf(";; reply from unexpected source: %s,"
" expected %s\n", buf1, buf2); " expected %s\n", buf1, buf2);
match = false; if (!l->accept_reply_unexpected_src) {
match = false;
}
} }
} }

View File

@@ -141,7 +141,9 @@ struct dig_lookup {
idnin, idnin,
idnout, idnout,
expandaaaa, expandaaaa,
qr; qr,
accept_reply_unexpected_src; /*% print replies from unexpected
sources. */
char textname[MXNAME]; /*% Name we're going to be looking up */ char textname[MXNAME]; /*% Name we're going to be looking up */
char cmdline[MXNAME]; char cmdline[MXNAME];
dns_rdatatype_t rdtype; dns_rdatatype_t rdtype;