From: Tony Finch Date: Fri, 2 Nov 2018 14:23:01 +0000 (+0000) Subject: Abolish ip6.int support in `dig` and `mdig` X-Git-Tag: v9.13.4~55^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3064d3d0efa1011262789824d6e69d3945ce386f;p=thirdparty%2Fbind9.git Abolish ip6.int support in `dig` and `mdig` --- diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 4249d308d23..0649c089fe8 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -65,7 +65,7 @@ static char domainopt[DNS_NAME_MAXTEXT]; static char hexcookie[81]; static bool short_form = false, printcmd = true, - ip6_int = false, plusquest = false, pluscomm = false, + plusquest = false, pluscomm = false, ipv4only = false, ipv6only = false; static uint32_t splitwidth = 0xffffffff; @@ -153,7 +153,6 @@ help(void) { " -b address[#port] (bind to source address/port)\n" " -c class (specify query class)\n" " -f filename (batch mode)\n" -" -i (use IP6.INT for IPv6 reverse lookups)\n" " -k keyfile (specify tsig key file)\n" " -m (enable memory usage debugging)\n" " -p port (specify port number)\n" @@ -1606,7 +1605,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, exit(0); break; case 'i': - ip6_int = true; + /* deprecated */ break; case 'm': /* memdebug */ /* memdebug is handled in preparse_args() */ @@ -1787,13 +1786,12 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, *lookup = clone_lookup(default_lookup, true); *need_clone = true; if (get_reverse(textname, sizeof(textname), value, - ip6_int, false) == ISC_R_SUCCESS) { + false) == ISC_R_SUCCESS) { strlcpy((*lookup)->textname, textname, sizeof((*lookup)->textname)); debug("looking up %s", (*lookup)->textname); (*lookup)->trace_root = ((*lookup)->trace || (*lookup)->ns_search_only); - (*lookup)->ip6_int = ip6_int; if (!(*lookup)->rdtypeset) (*lookup)->rdtype = dns_rdatatype_ptr; if (!(*lookup)->rdclassset) diff --git a/bin/dig/dig.docbook b/bin/dig/dig.docbook index f177ca713e8..05fccbe4dce 100644 --- a/bin/dig/dig.docbook +++ b/bin/dig/dig.docbook @@ -271,17 +271,6 @@ - - -i - - - Do reverse IPv6 lookups using the obsolete RFC 1886 IP6.INT - domain, which is no longer in use. Obsolete bit string - label queries (RFC 2874) are not attempted. - - - - -k keyfile @@ -394,8 +383,7 @@ 94.2.0.192.in-addr.arpa and sets the query type and class to PTR and IN respectively. IPv6 addresses are looked up using nibble format under the - IP6.ARPA domain (but see also the - option). + IP6.ARPA domain. diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index de7307aa43f..9750f140cd8 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -312,8 +312,7 @@ reverse_octets(const char *in, char **p, char *end) { } isc_result_t -get_reverse(char *reverse, size_t len, char *value, bool ip6_int, - bool strict) +get_reverse(char *reverse, size_t len, char *value, bool strict) { int r; isc_result_t result; @@ -327,8 +326,6 @@ get_reverse(char *reverse, size_t len, char *value, bool ip6_int, dns_name_t *name; unsigned int options = 0; - if (ip6_int) - options |= DNS_BYADDROPT_IPV6INT; name = dns_fixedname_initname(&fname); result = dns_byaddr_createptrname(&addr, options, name); if (result != ISC_R_SUCCESS) @@ -652,7 +649,6 @@ make_empty_lookup(void) { looknew->nsfound = 0; looknew->tcp_mode = false; looknew->tcp_mode_set = false; - looknew->ip6_int = false; looknew->comments = true; looknew->stats = true; looknew->section_question = true; diff --git a/bin/dig/host.c b/bin/dig/host.c index ce2442d94a4..e5b31ab2024 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -143,7 +143,6 @@ show_usage(void) { " -c specifies query class for non-IN data\n" " -C compares SOA records on authoritative nameservers\n" " -d is equivalent to -v\n" -" -i IP6.INT reverse lookups\n" " -l lists all hosts in a domain, using AXFR\n" " -m set memory debugging flag (trace|record|usage)\n" " -N changes the number of dots allowed before root lookup is done\n" @@ -762,7 +761,7 @@ parse_args(bool is_batchfile, int argc, char **argv) { default_lookups = false; break; case 'i': - lookup->ip6_int = true; + /* deprecated */ break; case 'n': /* deprecated */ @@ -841,8 +840,8 @@ parse_args(bool is_batchfile, int argc, char **argv) { check_ra = true; lookup->pending = false; - if (get_reverse(store, sizeof(store), hostname, - lookup->ip6_int, true) == ISC_R_SUCCESS) { + if (get_reverse(store, sizeof(store), hostname, true) + == ISC_R_SUCCESS) { strlcpy(lookup->textname, store, sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_ptr; lookup->rdtypeset = true; diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook index 1db8798d30f..e754fd7d448 100644 --- a/bin/dig/host.docbook +++ b/bin/dig/host.docbook @@ -179,18 +179,6 @@ - - -i - - - Obsolete. - Use the IP6.INT domain for reverse lookups of IPv6 - addresses as defined in RFC1886 and deprecated in RFC4159. - The default is to use IP6.ARPA as specified in RFC3596. - - - - -l diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h index e7c14a4b854..a224c705a31 100644 --- a/bin/dig/include/dig/dig.h +++ b/bin/dig/include/dig/dig.h @@ -103,7 +103,6 @@ struct dig_lookup { trace_root, /*% initial query for either +trace or +nssearch */ tcp_mode, tcp_mode_set, - ip6_int, comments, stats, section_question, @@ -280,8 +279,7 @@ int getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp); isc_result_t -get_reverse(char *reverse, size_t len, char *value, bool ip6_int, - bool strict); +get_reverse(char *reverse, size_t len, char *value, bool strict); ISC_PLATFORM_NORETURN_PRE void fatal(const char *format, ...) diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 77b940d2e6a..163f68d057e 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -772,7 +772,7 @@ addlookup(char *opt) { rdclass = dns_rdataclass_in; } lookup = make_empty_lookup(); - if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, true) + if (get_reverse(store, sizeof(store), opt, true) == ISC_R_SUCCESS) { strlcpy(lookup->textname, store, sizeof(lookup->textname)); lookup->rdtype = dns_rdatatype_ptr; diff --git a/bin/tools/mdig.c b/bin/tools/mdig.c index 899963c784c..9365b52fa71 100644 --- a/bin/tools/mdig.c +++ b/bin/tools/mdig.c @@ -120,7 +120,6 @@ static char hexcookie[81]; struct query { char textname[MXNAME]; /*% Name we're going to be looking up */ - bool ip6_int; bool recurse; bool have_aaonly; bool have_adflag; @@ -774,7 +773,6 @@ help(void) { " local opt is one of:\n" " -c class (specify query class)\n" " -t type (specify query type)\n" -" -i (use IP6.INT for IPv6 reverse lookups)\n" " -x dot-notation (shortcut for reverse lookups)\n" " +timeout=### (Set query timeout) [UDP=5,TCP=10]\n" " +udptimeout=### (Set timeout before UDP retry)\n" @@ -995,8 +993,7 @@ reverse_octets(const char *in, char **p, char *end) { } static void -get_reverse(char *reverse, size_t len, const char *value, - bool ip6_int) +get_reverse(char *reverse, size_t len, const char *value) { int r; isc_result_t result; @@ -1010,8 +1007,6 @@ get_reverse(char *reverse, size_t len, const char *value, dns_name_t *name; unsigned int options = 0; - if (ip6_int) - options |= DNS_BYADDROPT_IPV6INT; name = dns_fixedname_initname(&fname); result = dns_byaddr_createptrname(&addr, options, name); CHECK("dns_byaddr_createptrname2", result); @@ -1594,7 +1589,7 @@ dash_option(const char *option, char *next, struct query *query, exit(0); break; case 'i': - query->ip6_int = true; + /* deprecated */ break; case 'm': /* @@ -1674,7 +1669,7 @@ dash_option(const char *option, char *next, struct query *query, query->rdtype = rdtype; return (value_from_next); case 'x': - get_reverse(textname, sizeof(textname), value, query->ip6_int); + get_reverse(textname, sizeof(textname), value); strlcpy(query->textname, textname, sizeof(query->textname)); query->rdtype = dns_rdatatype_ptr; query->rdclass = dns_rdataclass_in; @@ -1788,7 +1783,6 @@ parse_args(bool is_batchfile, int argc, char **argv) if (!is_batchfile) { default_query.textname[0] = 0; - default_query.ip6_int = false; default_query.recurse = true; default_query.have_aaonly = false; default_query.have_adflag = true; /*XXX*/ diff --git a/bin/tools/mdig.docbook b/bin/tools/mdig.docbook index 1f65e6fefb9..24a7d54ebd0 100644 --- a/bin/tools/mdig.docbook +++ b/bin/tools/mdig.docbook @@ -420,11 +420,6 @@ a reverse lookup with the "PTR" query type. - - The option sets the reverse domain for - IPv6 addresses to IP6.INT. - - Reverse lookups — mapping addresses to names — are simplified by the option. @@ -434,8 +429,7 @@ query name like 11.12.13.10.in-addr.arpa and sets the query type and class to PTR and IN respectively. By default, IPv6 addresses are looked up using nibble format - under the IP6.ARPA domain. To use the older RFC1886 method - using the IP6.INT domain specify the option. + under the IP6.ARPA domain. diff --git a/lib/dns/byaddr.c b/lib/dns/byaddr.c index 565d63b0ff9..a91b347ca7b 100644 --- a/lib/dns/byaddr.c +++ b/lib/dns/byaddr.c @@ -55,6 +55,7 @@ dns_byaddr_createptrname(const isc_netaddr_t *address, unsigned int options, unsigned int len; REQUIRE(address != NULL); + UNUSED(options); /* * We create the text representation and then convert to a @@ -81,11 +82,7 @@ dns_byaddr_createptrname(const isc_netaddr_t *address, unsigned int options, *cp++ = '.'; } remaining = sizeof(textname) - (cp - textname); - if ((options & DNS_BYADDROPT_IPV6INT) != 0) { - strlcpy(cp, "ip6.int.", remaining); - } else { - strlcpy(cp, "ip6.arpa.", remaining); - } + strlcpy(cp, "ip6.arpa.", remaining); } else return (ISC_R_NOTIMPLEMENTED); diff --git a/lib/dns/include/dns/byaddr.h b/lib/dns/include/dns/byaddr.h index 893ca4d6bfd..a020850259c 100644 --- a/lib/dns/include/dns/byaddr.h +++ b/lib/dns/include/dns/byaddr.h @@ -60,13 +60,6 @@ typedef struct dns_byaddrevent { dns_namelist_t names; } dns_byaddrevent_t; -/* - * This option is deprecated since we now only consider nibbles. -#define DNS_BYADDROPT_IPV6NIBBLE 0x0001 - */ -/*% Note DNS_BYADDROPT_IPV6NIBBLE is now deprecated. */ -#define DNS_BYADDROPT_IPV6INT 0x0002 - isc_result_t dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address, dns_view_t *view, unsigned int options, isc_task_t *task, @@ -84,8 +77,6 @@ dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address, * 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. * \endcode * - *\li #DNS_BYADDROPT_IPV6INT can be used to get nibble lookups under ip6.int. - * * Requires: * *\li 'mctx' is a valid mctx.