mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 08:35:31 +00:00
Merge branch 'u/fanf2/deprecate-ip6-int' into 'master'
Abolish ip6.int support in `dig` and `mdig` See merge request isc-projects/bind9!969
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
5077. [cleanup] Remove ip6.int support (-i) from dig and mdig.
|
||||||
|
[GL !969]
|
||||||
|
|
||||||
5076. [bug] "require-server-cookie" was not effective if
|
5076. [bug] "require-server-cookie" was not effective if
|
||||||
"rate-limit" was configured. [GL #617]
|
"rate-limit" was configured. [GL #617]
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ static char domainopt[DNS_NAME_MAXTEXT];
|
|||||||
static char hexcookie[81];
|
static char hexcookie[81];
|
||||||
|
|
||||||
static bool short_form = false, printcmd = true,
|
static bool short_form = false, printcmd = true,
|
||||||
ip6_int = false, plusquest = false, pluscomm = false,
|
plusquest = false, pluscomm = false,
|
||||||
ipv4only = false, ipv6only = false;
|
ipv4only = false, ipv6only = false;
|
||||||
static uint32_t splitwidth = 0xffffffff;
|
static uint32_t splitwidth = 0xffffffff;
|
||||||
|
|
||||||
@@ -153,7 +153,6 @@ help(void) {
|
|||||||
" -b address[#port] (bind to source address/port)\n"
|
" -b address[#port] (bind to source address/port)\n"
|
||||||
" -c class (specify query class)\n"
|
" -c class (specify query class)\n"
|
||||||
" -f filename (batch mode)\n"
|
" -f filename (batch mode)\n"
|
||||||
" -i (use IP6.INT for IPv6 reverse lookups)\n"
|
|
||||||
" -k keyfile (specify tsig key file)\n"
|
" -k keyfile (specify tsig key file)\n"
|
||||||
" -m (enable memory usage debugging)\n"
|
" -m (enable memory usage debugging)\n"
|
||||||
" -p port (specify port number)\n"
|
" -p port (specify port number)\n"
|
||||||
@@ -1606,7 +1605,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
ip6_int = true;
|
/* deprecated */
|
||||||
break;
|
break;
|
||||||
case 'm': /* memdebug */
|
case 'm': /* memdebug */
|
||||||
/* memdebug is handled in preparse_args() */
|
/* 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);
|
*lookup = clone_lookup(default_lookup, true);
|
||||||
*need_clone = true;
|
*need_clone = true;
|
||||||
if (get_reverse(textname, sizeof(textname), value,
|
if (get_reverse(textname, sizeof(textname), value,
|
||||||
ip6_int, false) == ISC_R_SUCCESS) {
|
false) == ISC_R_SUCCESS) {
|
||||||
strlcpy((*lookup)->textname, textname,
|
strlcpy((*lookup)->textname, textname,
|
||||||
sizeof((*lookup)->textname));
|
sizeof((*lookup)->textname));
|
||||||
debug("looking up %s", (*lookup)->textname);
|
debug("looking up %s", (*lookup)->textname);
|
||||||
(*lookup)->trace_root = ((*lookup)->trace ||
|
(*lookup)->trace_root = ((*lookup)->trace ||
|
||||||
(*lookup)->ns_search_only);
|
(*lookup)->ns_search_only);
|
||||||
(*lookup)->ip6_int = ip6_int;
|
|
||||||
if (!(*lookup)->rdtypeset)
|
if (!(*lookup)->rdtypeset)
|
||||||
(*lookup)->rdtype = dns_rdatatype_ptr;
|
(*lookup)->rdtype = dns_rdatatype_ptr;
|
||||||
if (!(*lookup)->rdclassset)
|
if (!(*lookup)->rdclassset)
|
||||||
|
@@ -271,17 +271,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>-i</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
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.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>-k <replaceable class="parameter">keyfile</replaceable></term>
|
<term>-k <replaceable class="parameter">keyfile</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -394,8 +383,7 @@
|
|||||||
<literal>94.2.0.192.in-addr.arpa</literal> and sets the
|
<literal>94.2.0.192.in-addr.arpa</literal> and sets the
|
||||||
query type and class to PTR and IN respectively. IPv6
|
query type and class to PTR and IN respectively. IPv6
|
||||||
addresses are looked up using nibble format under the
|
addresses are looked up using nibble format under the
|
||||||
IP6.ARPA domain (but see also the <option>-i</option>
|
IP6.ARPA domain.
|
||||||
option).
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@@ -312,8 +312,7 @@ reverse_octets(const char *in, char **p, char *end) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
get_reverse(char *reverse, size_t len, char *value, bool ip6_int,
|
get_reverse(char *reverse, size_t len, char *value, bool strict)
|
||||||
bool strict)
|
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
@@ -327,8 +326,6 @@ get_reverse(char *reverse, size_t len, char *value, bool ip6_int,
|
|||||||
dns_name_t *name;
|
dns_name_t *name;
|
||||||
unsigned int options = 0;
|
unsigned int options = 0;
|
||||||
|
|
||||||
if (ip6_int)
|
|
||||||
options |= DNS_BYADDROPT_IPV6INT;
|
|
||||||
name = dns_fixedname_initname(&fname);
|
name = dns_fixedname_initname(&fname);
|
||||||
result = dns_byaddr_createptrname(&addr, options, name);
|
result = dns_byaddr_createptrname(&addr, options, name);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
@@ -652,7 +649,6 @@ make_empty_lookup(void) {
|
|||||||
looknew->nsfound = 0;
|
looknew->nsfound = 0;
|
||||||
looknew->tcp_mode = false;
|
looknew->tcp_mode = false;
|
||||||
looknew->tcp_mode_set = false;
|
looknew->tcp_mode_set = false;
|
||||||
looknew->ip6_int = false;
|
|
||||||
looknew->comments = true;
|
looknew->comments = true;
|
||||||
looknew->stats = true;
|
looknew->stats = true;
|
||||||
looknew->section_question = true;
|
looknew->section_question = true;
|
||||||
|
@@ -143,7 +143,6 @@ show_usage(void) {
|
|||||||
" -c specifies query class for non-IN data\n"
|
" -c specifies query class for non-IN data\n"
|
||||||
" -C compares SOA records on authoritative nameservers\n"
|
" -C compares SOA records on authoritative nameservers\n"
|
||||||
" -d is equivalent to -v\n"
|
" -d is equivalent to -v\n"
|
||||||
" -i IP6.INT reverse lookups\n"
|
|
||||||
" -l lists all hosts in a domain, using AXFR\n"
|
" -l lists all hosts in a domain, using AXFR\n"
|
||||||
" -m set memory debugging flag (trace|record|usage)\n"
|
" -m set memory debugging flag (trace|record|usage)\n"
|
||||||
" -N changes the number of dots allowed before root lookup is done\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;
|
default_lookups = false;
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
lookup->ip6_int = true;
|
/* deprecated */
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
/* deprecated */
|
/* deprecated */
|
||||||
@@ -841,8 +840,8 @@ parse_args(bool is_batchfile, int argc, char **argv) {
|
|||||||
check_ra = true;
|
check_ra = true;
|
||||||
|
|
||||||
lookup->pending = false;
|
lookup->pending = false;
|
||||||
if (get_reverse(store, sizeof(store), hostname,
|
if (get_reverse(store, sizeof(store), hostname, true)
|
||||||
lookup->ip6_int, true) == ISC_R_SUCCESS) {
|
== ISC_R_SUCCESS) {
|
||||||
strlcpy(lookup->textname, store, sizeof(lookup->textname));
|
strlcpy(lookup->textname, store, sizeof(lookup->textname));
|
||||||
lookup->rdtype = dns_rdatatype_ptr;
|
lookup->rdtype = dns_rdatatype_ptr;
|
||||||
lookup->rdtypeset = true;
|
lookup->rdtypeset = true;
|
||||||
|
@@ -179,18 +179,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>-i</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
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.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>-l</term>
|
<term>-l</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@@ -103,7 +103,6 @@ struct dig_lookup {
|
|||||||
trace_root, /*% initial query for either +trace or +nssearch */
|
trace_root, /*% initial query for either +trace or +nssearch */
|
||||||
tcp_mode,
|
tcp_mode,
|
||||||
tcp_mode_set,
|
tcp_mode_set,
|
||||||
ip6_int,
|
|
||||||
comments,
|
comments,
|
||||||
stats,
|
stats,
|
||||||
section_question,
|
section_question,
|
||||||
@@ -280,8 +279,7 @@ int
|
|||||||
getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
|
getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
get_reverse(char *reverse, size_t len, char *value, bool ip6_int,
|
get_reverse(char *reverse, size_t len, char *value, bool strict);
|
||||||
bool strict);
|
|
||||||
|
|
||||||
ISC_PLATFORM_NORETURN_PRE void
|
ISC_PLATFORM_NORETURN_PRE void
|
||||||
fatal(const char *format, ...)
|
fatal(const char *format, ...)
|
||||||
|
@@ -772,7 +772,7 @@ addlookup(char *opt) {
|
|||||||
rdclass = dns_rdataclass_in;
|
rdclass = dns_rdataclass_in;
|
||||||
}
|
}
|
||||||
lookup = make_empty_lookup();
|
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) {
|
== ISC_R_SUCCESS) {
|
||||||
strlcpy(lookup->textname, store, sizeof(lookup->textname));
|
strlcpy(lookup->textname, store, sizeof(lookup->textname));
|
||||||
lookup->rdtype = dns_rdatatype_ptr;
|
lookup->rdtype = dns_rdatatype_ptr;
|
||||||
|
@@ -120,7 +120,6 @@ static char hexcookie[81];
|
|||||||
|
|
||||||
struct query {
|
struct query {
|
||||||
char textname[MXNAME]; /*% Name we're going to be looking up */
|
char textname[MXNAME]; /*% Name we're going to be looking up */
|
||||||
bool ip6_int;
|
|
||||||
bool recurse;
|
bool recurse;
|
||||||
bool have_aaonly;
|
bool have_aaonly;
|
||||||
bool have_adflag;
|
bool have_adflag;
|
||||||
@@ -774,7 +773,6 @@ help(void) {
|
|||||||
" local opt is one of:\n"
|
" local opt is one of:\n"
|
||||||
" -c class (specify query class)\n"
|
" -c class (specify query class)\n"
|
||||||
" -t type (specify query type)\n"
|
" -t type (specify query type)\n"
|
||||||
" -i (use IP6.INT for IPv6 reverse lookups)\n"
|
|
||||||
" -x dot-notation (shortcut for reverse lookups)\n"
|
" -x dot-notation (shortcut for reverse lookups)\n"
|
||||||
" +timeout=### (Set query timeout) [UDP=5,TCP=10]\n"
|
" +timeout=### (Set query timeout) [UDP=5,TCP=10]\n"
|
||||||
" +udptimeout=### (Set timeout before UDP retry)\n"
|
" +udptimeout=### (Set timeout before UDP retry)\n"
|
||||||
@@ -995,8 +993,7 @@ reverse_octets(const char *in, char **p, char *end) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_reverse(char *reverse, size_t len, const char *value,
|
get_reverse(char *reverse, size_t len, const char *value)
|
||||||
bool ip6_int)
|
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
@@ -1010,8 +1007,6 @@ get_reverse(char *reverse, size_t len, const char *value,
|
|||||||
dns_name_t *name;
|
dns_name_t *name;
|
||||||
unsigned int options = 0;
|
unsigned int options = 0;
|
||||||
|
|
||||||
if (ip6_int)
|
|
||||||
options |= DNS_BYADDROPT_IPV6INT;
|
|
||||||
name = dns_fixedname_initname(&fname);
|
name = dns_fixedname_initname(&fname);
|
||||||
result = dns_byaddr_createptrname(&addr, options, name);
|
result = dns_byaddr_createptrname(&addr, options, name);
|
||||||
CHECK("dns_byaddr_createptrname2", result);
|
CHECK("dns_byaddr_createptrname2", result);
|
||||||
@@ -1594,7 +1589,7 @@ dash_option(const char *option, char *next, struct query *query,
|
|||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
query->ip6_int = true;
|
/* deprecated */
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
/*
|
/*
|
||||||
@@ -1674,7 +1669,7 @@ dash_option(const char *option, char *next, struct query *query,
|
|||||||
query->rdtype = rdtype;
|
query->rdtype = rdtype;
|
||||||
return (value_from_next);
|
return (value_from_next);
|
||||||
case 'x':
|
case 'x':
|
||||||
get_reverse(textname, sizeof(textname), value, query->ip6_int);
|
get_reverse(textname, sizeof(textname), value);
|
||||||
strlcpy(query->textname, textname, sizeof(query->textname));
|
strlcpy(query->textname, textname, sizeof(query->textname));
|
||||||
query->rdtype = dns_rdatatype_ptr;
|
query->rdtype = dns_rdatatype_ptr;
|
||||||
query->rdclass = dns_rdataclass_in;
|
query->rdclass = dns_rdataclass_in;
|
||||||
@@ -1788,7 +1783,6 @@ parse_args(bool is_batchfile, int argc, char **argv)
|
|||||||
|
|
||||||
if (!is_batchfile) {
|
if (!is_batchfile) {
|
||||||
default_query.textname[0] = 0;
|
default_query.textname[0] = 0;
|
||||||
default_query.ip6_int = false;
|
|
||||||
default_query.recurse = true;
|
default_query.recurse = true;
|
||||||
default_query.have_aaonly = false;
|
default_query.have_aaonly = false;
|
||||||
default_query.have_adflag = true; /*XXX*/
|
default_query.have_adflag = true; /*XXX*/
|
||||||
|
@@ -420,11 +420,6 @@
|
|||||||
a reverse lookup with the "PTR" query type.
|
a reverse lookup with the "PTR" query type.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
|
||||||
The <option>-i</option> option sets the reverse domain for
|
|
||||||
IPv6 addresses to IP6.INT.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Reverse lookups — mapping addresses to names — are
|
Reverse lookups — mapping addresses to names — are
|
||||||
simplified by the <option>-x</option> option.
|
simplified by the <option>-x</option> option.
|
||||||
@@ -434,8 +429,7 @@
|
|||||||
query name like <literal>11.12.13.10.in-addr.arpa</literal> and
|
query name like <literal>11.12.13.10.in-addr.arpa</literal> and
|
||||||
sets the query type and class to PTR and IN respectively.
|
sets the query type and class to PTR and IN respectively.
|
||||||
By default, IPv6 addresses are looked up using nibble format
|
By default, IPv6 addresses are looked up using nibble format
|
||||||
under the IP6.ARPA domain. To use the older RFC1886 method
|
under the IP6.ARPA domain.
|
||||||
using the IP6.INT domain specify the <option>-i</option> option.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@@ -55,6 +55,7 @@ dns_byaddr_createptrname(const isc_netaddr_t *address, unsigned int options,
|
|||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
REQUIRE(address != NULL);
|
REQUIRE(address != NULL);
|
||||||
|
UNUSED(options);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We create the text representation and then convert to a
|
* 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++ = '.';
|
*cp++ = '.';
|
||||||
}
|
}
|
||||||
remaining = sizeof(textname) - (cp - textname);
|
remaining = sizeof(textname) - (cp - textname);
|
||||||
if ((options & DNS_BYADDROPT_IPV6INT) != 0) {
|
strlcpy(cp, "ip6.arpa.", remaining);
|
||||||
strlcpy(cp, "ip6.int.", remaining);
|
|
||||||
} else {
|
|
||||||
strlcpy(cp, "ip6.arpa.", remaining);
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
return (ISC_R_NOTIMPLEMENTED);
|
return (ISC_R_NOTIMPLEMENTED);
|
||||||
|
|
||||||
|
@@ -60,13 +60,6 @@ typedef struct dns_byaddrevent {
|
|||||||
dns_namelist_t names;
|
dns_namelist_t names;
|
||||||
} dns_byaddrevent_t;
|
} 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
|
isc_result_t
|
||||||
dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address,
|
dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address,
|
||||||
dns_view_t *view, unsigned int options, isc_task_t *task,
|
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.
|
* 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
|
* \endcode
|
||||||
*
|
*
|
||||||
*\li #DNS_BYADDROPT_IPV6INT can be used to get nibble lookups under ip6.int.
|
|
||||||
*
|
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
*\li 'mctx' is a valid mctx.
|
*\li 'mctx' is a valid mctx.
|
||||||
|
Reference in New Issue
Block a user