"in records)\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\" "
"format)\n"
switch (cmd[2]) {
case 'e':
FULLCHECK("unexpected");
- lookup->accept_reply_unexpected_src = state;
+ fprintf(stderr, ";; +unexpected option "
+ "is deprecated");
break;
case 'k':
FULLCHECK("unknownformat");
units of ``s``, ``m``, ``h``, ``d``, and ``w``, representing seconds, minutes,
hours, days, and weeks. This implies ``+ttlid``.
-``+[no]unexpected``
- This option accepts [or does not accept] answers from unexpected sources. By default, ``dig``
- will not accept a reply from a source other than the one to which it sent the
- query.
-
``+[no]unknownformat``
This option prints all RDATA in unknown RR type presentation format (:rfc:`3597`).
The default is to print RDATA for known types in the type's
looknew->ttlunits = false;
looknew->expandaaaa = false;
looknew->qr = false;
- looknew->accept_reply_unexpected_src = false;
#ifdef HAVE_LIBIDN2
looknew->idnin = isatty(1) ? (getenv("IDN_DISABLE") == NULL) : false;
looknew->idnout = looknew->idnin;
looknew->ttlunits = lookold->ttlunits;
looknew->expandaaaa = lookold->expandaaaa;
looknew->qr = lookold->qr;
- looknew->accept_reply_unexpected_src =
- lookold->accept_reply_unexpected_src;
looknew->idnin = lookold->idnin;
looknew->idnout = lookold->idnout;
looknew->udpsize = lookold->udpsize;
isc_buffer_add(&b, region->length);
peer = isc_nmhandle_peeraddr(handle);
- if (!l->tcp_mode &&
- !isc_sockaddr_compare(&peer, &query->sockaddr,
- ISC_SOCKADDR_CMPADDR | ISC_SOCKADDR_CMPPORT |
- ISC_SOCKADDR_CMPSCOPE |
- ISC_SOCKADDR_CMPSCOPEZERO))
- {
- char buf1[ISC_SOCKADDR_FORMATSIZE];
- char buf2[ISC_SOCKADDR_FORMATSIZE];
- isc_sockaddr_t any;
-
- if (isc_sockaddr_pf(&query->sockaddr) == AF_INET) {
- isc_sockaddr_any(&any);
- } else {
- isc_sockaddr_any6(&any);
- }
-
- /*
- * We don't expect a match when the packet is
- * sent to 0.0.0.0, :: or to a multicast addresses.
- * XXXMPA broadcast needs to be handled here as well.
- */
- if ((!isc_sockaddr_eqaddr(&query->sockaddr, &any) &&
- !isc_sockaddr_ismulticast(&query->sockaddr)) ||
- isc_sockaddr_getport(&query->sockaddr) !=
- isc_sockaddr_getport(&peer))
- {
- isc_sockaddr_format(&peer, buf1, sizeof(buf1));
- isc_sockaddr_format(&query->sockaddr, buf2,
- sizeof(buf2));
- dighost_warning("reply from unexpected source: %s,"
- " expected %s\n",
- buf1, buf2);
- if (!l->accept_reply_unexpected_src) {
- match = false;
- }
- }
- }
result = dns_message_peekheader(&b, &id, &msgflags);
if (result != ISC_R_SUCCESS || l->sendmsg->id != id) {
tcp_keepalive, header_only, ednsneg, mapped,
print_unknown_format, multiline, nottl, noclass, onesoa,
use_usec, nocrypto, ttlunits, idnin, idnout, expandaaaa, qr,
- accept_reply_unexpected_src, /*% print replies from
- * unexpected
- * sources. */
- setqid; /*% use a speciied query ID */
- char textname[MXNAME]; /*% Name we're going to be
- * looking up */
+ setqid; /*% use a specified query ID */
+ char textname[MXNAME]; /*% Name we're going to be
+ * looking up */
char cmdline[MXNAME];
dns_rdatatype_t rdtype;
dns_rdatatype_t qrdtype;
status=$((status+ret))
fi
- n=$((n+1))
- echo_i "check that dig +unexpected works ($n)"
- ret=0
- dig_with_opts @10.53.0.6 +tries=1 +time=2 +unexpected a a.example > dig.out.test$n || ret=1
- grep 'reply from unexpected source' dig.out.test$n > /dev/null || ret=1
- grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
- if [ $ret -ne 0 ]; then echo_i "failed"; fi
- status=$((status+ret))
-
- n=$((n+1))
- echo_i "check that dig +nounexpected works ($n)"
- ret=0
- dig_with_opts @10.53.0.6 +nounexpected +tries=1 +time=2 a a.example > dig.out.test$n && ret=1
- grep 'reply from unexpected source' dig.out.test$n > /dev/null || ret=1
- grep "status: NOERROR" < dig.out.test$n > /dev/null && ret=1
- if [ $ret -ne 0 ]; then echo_i "failed"; fi
- status=$((status+ret))
-
- n=$((n+1))
- echo_i "check that dig default for +[no]unexpected (+nounexpected) works ($n)"
- ret=0
- dig_with_opts @10.53.0.6 +tries=1 +time=2 a a.example > dig.out.test$n && ret=1
- grep 'reply from unexpected source' dig.out.test$n > /dev/null || ret=1
- grep "status: NOERROR" < dig.out.test$n > /dev/null && ret=1
- if [ $ret -ne 0 ]; then echo_i "failed"; fi
- status=$((status+ret))
-
n=$((n+1))
echo_i "check that dig +bufsize=0 just sets the buffer size to 0 ($n)"
ret=0