From: Ondřej Surý Date: Thu, 13 Jan 2022 12:29:09 +0000 (+0100) Subject: Remove +mapped option from dig X-Git-Tag: v9.18.0~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7267c3932362fe100ee2717b8a8ada1d21ce7987;p=thirdparty%2Fbind9.git Remove +mapped option from dig The network manager doesn't have support for IPv4-mapped IPv6 addresses, thus we are removing the +mapped option from dig command. --- diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 27aa5b4d478..19a9d5b0f30 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -248,8 +248,6 @@ help(void) { " +[no]keepopen (Keep the TCP socket open " "between " "queries)\n" - " +[no]mapped (Allow mapped IPv4 over " - "IPv6)\n" " +[no]multiline (Print records in an " "expanded format)\n" " +ndots=### (Set search NDOTS value)\n" @@ -1584,7 +1582,7 @@ plus_option(char *option, bool is_batchfile, bool *need_clone, switch (cmd[1]) { case 'a': FULLCHECK("mapped"); - lookup->mapped = state; + fprintf(stderr, ";; +mapped option is deprecated"); break; case 'u': FULLCHECK("multiline"); diff --git a/bin/dig/dig.rst b/bin/dig/dig.rst index 84ff1e4e8e1..556b41d69f7 100644 --- a/bin/dig/dig.rst +++ b/bin/dig/dig.rst @@ -400,10 +400,6 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to creating a new TCP socket for each lookup. The default is ``+nokeepopen``. -``+[no]mapped`` - This option allows [or does not allow] mapped IPv4-over-IPv6 addresses to be used. The default is - ``+mapped``. - ``+[no]multiline`` This option prints [or does not print] records, like the SOA records, in a verbose multi-line format with human-readable comments. The default is to print each record on diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index a101b5c8501..e09c547e3c5 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -631,7 +631,6 @@ make_empty_lookup(void) { .section_authority = true, .section_additional = true, .ednsneg = true, - .mapped = true, .dscp = -1, }; @@ -743,7 +742,6 @@ clone_lookup(dig_lookup_t *lookold, bool servers) { } looknew->ednsneg = lookold->ednsneg; looknew->padding = lookold->padding; - looknew->mapped = lookold->mapped; looknew->multiline = lookold->multiline; looknew->nottl = lookold->nottl; looknew->noclass = lookold->noclass; @@ -2724,8 +2722,7 @@ start_tcp(dig_query_t *query) { return; } - if (!query->lookup->mapped && - isc_sockaddr_pf(&query->sockaddr) == AF_INET6 && + if (isc_sockaddr_pf(&query->sockaddr) == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&query->sockaddr.type.sin6.sin6_addr)) { isc_netaddr_t netaddr; @@ -2952,8 +2949,7 @@ start_udp(dig_query_t *query) { return; } - if (!query->lookup->mapped && - isc_sockaddr_pf(&query->sockaddr) == AF_INET6 && + if (isc_sockaddr_pf(&query->sockaddr) == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&query->sockaddr.type.sin6.sin6_addr)) { isc_netaddr_t netaddr; diff --git a/bin/dig/dighost.h b/bin/dig/dighost.h index 8b09b5c7007..618e975096f 100644 --- a/bin/dig/dighost.h +++ b/bin/dig/dighost.h @@ -111,9 +111,9 @@ struct dig_lookup { message */ identify_previous_line, /*% Prepend a "Nameserver :" message, with newline and tab */ - idnin, idnout, ignore, mapped, multiline, need_search, - new_search, noclass, nocrypto, nottl, - ns_search_only, /*%< dig +nssearch, host -C */ + idnin, idnout, ignore, multiline, need_search, new_search, + noclass, nocrypto, nottl, ns_search_only, /*%< dig +nssearch, + host -C */ nsid, /*% Name Server ID (RFC 5001) */ onesoa, pending, /*%< Pending a successful answer */ print_unknown_format, qr, raflag, recurse, section_additional, diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index f1b8f9db9df..f4db8a43893 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -389,24 +389,11 @@ if [ -x "$DIG" ] ; then fi n=$((n+1)) - echo_i "checking dig @IPv4addr -6 +mapped A a.example ($n)" - if testsock6 fd92:7065:b8e:ffff::2 2>/dev/null && [ "$(uname -s)" != "OpenBSD" ] - then - ret=0 - dig_with_opts +tcp @10.53.0.2 -6 +mapped A a.example > dig.out.test$n 2>&1 || ret=1 - grep "SERVER: ::ffff:10.53.0.2#$PORT" < dig.out.test$n > /dev/null || ret=1 - if [ $ret -ne 0 ]; then echo_i "failed"; fi - status=$((status+ret)) - else - echo_i "IPv6 or IPv4-to-IPv6 mapping unavailable; skipping" - fi - - n=$((n+1)) - echo_i "checking dig +tcp @IPv4addr -6 +nomapped A a.example ($n)" + echo_i "checking dig +tcp @IPv4addr -6 A a.example ($n)" if testsock6 fd92:7065:b8e:ffff::2 2>/dev/null then ret=0 - dig_with_opts +tcp @10.53.0.2 -6 +nomapped A a.example > dig.out.test$n 2>&1 || ret=1 + dig_with_opts +tcp @10.53.0.2 -6 A a.example > dig.out.test$n 2>&1 || ret=1 grep "SERVER: ::ffff:10.53.0.2#$PORT" < dig.out.test$n > /dev/null && ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -415,11 +402,11 @@ if [ -x "$DIG" ] ; then fi n=$((n+1)) - echo_i "checking dig +notcp @IPv4addr -6 +nomapped A a.example ($n)" + echo_i "checking dig +notcp @IPv4addr -6 A a.example ($n)" if testsock6 fd92:7065:b8e:ffff::2 2>/dev/null then ret=0 - dig_with_opts +notcp @10.53.0.2 -6 +nomapped A a.example > dig.out.test$n 2>&1 || ret=1 + dig_with_opts +notcp @10.53.0.2 -6 A a.example > dig.out.test$n 2>&1 || ret=1 grep "SERVER: ::ffff:10.53.0.2#$PORT" < dig.out.test$n > /dev/null && ret=1 if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) diff --git a/doc/man/dig.1in b/doc/man/dig.1in index 6bbecbaf2cf..f75e6a6c1f6 100644 --- a/doc/man/dig.1in +++ b/doc/man/dig.1in @@ -422,10 +422,6 @@ This option keeps [or does not keep] the TCP socket open between queries, and re creating a new TCP socket for each lookup. The default is \fB+nokeepopen\fP\&. .TP -.B \fB+[no]mapped\fP -This option allows [or does not allow] mapped IPv4\-over\-IPv6 addresses to be used. The default is -\fB+mapped\fP\&. -.TP .B \fB+[no]multiline\fP This option prints [or does not print] records, like the SOA records, in a verbose multi\-line format with human\-readable comments. The default is to print each record on