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.
This commit is contained in:
Ondřej Surý 2022-01-13 13:29:09 +01:00
parent b5e086257d
commit 7267c39323
6 changed files with 10 additions and 37 deletions

View file

@ -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");

View file

@ -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

View file

@ -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;

View file

@ -111,9 +111,9 @@ struct dig_lookup {
message */
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
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,

View file

@ -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))

View file

@ -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