Report information
The Basics
Id:
45433
Status:
resolved
Priority:
Medium/Medium
Queue:

People
Owner:
Nobody in particular
Cc:
AdminCc:

BugTracker
Version Fixed:
9.11.3, 9.12.0
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
9.9.12, 9.10.7, 9.11.3, 9.12
Priority:
P2 Normal
Severity:
S2 Normal
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
BIND Server
Area:
feature

Dates
Created:Wed, 21 Jun 2017 11:51:05 -0400
Updated:Mon, 13 Nov 2017 08:28:44 -0500
Closed:Mon, 13 Nov 2017 08:28:44 -0500



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

To: "Mark Andrews via RT" <bind9-bugs@isc.org>
Subject: [PATCH] Use DNS_NAME_INITABSOLUTE() in query.c
CC: "Tony Finch" <dot@dotat.at>
Date: Wed, 21 Jun 2017 16:50:53 +0100
From: "Tony Finch" <dot@dotat.at>
--- bin/named/query.c | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/bin/named/query.c b/bin/named/query.c index 6ce450a..4e58266 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -32,6 +32,7 @@ #include <dns/dnssec.h> #include <dns/events.h> #include <dns/message.h> +#include <dns/name.h> #include <dns/ncache.h> #include <dns/nsec3.h> #include <dns/order.h> @@ -3988,15 +3989,6 @@ rdata_tonetaddr(const dns_rdata_t *rdata, isc_netaddr_t *netaddr) { } } -#define NS_NAME_INIT(A,B) \ - { \ - DNS_NAME_MAGIC, \ - A, sizeof(A), sizeof(B), \ - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, \ - B, NULL, { (void *)-1, (void *)-1}, \ - {NULL, NULL} \ - } - static unsigned char inaddr10_offsets[] = { 0, 3, 11, 16 }; static unsigned char inaddr172_offsets[] = { 0, 3, 7, 15, 20 }; static unsigned char inaddr192_offsets[] = { 0, 4, 8, 16, 21 }; @@ -4023,24 +4015,24 @@ static unsigned char inaddr31172[] = "\00231\003172\007IN-ADDR\004ARPA"; static unsigned char inaddr168192[] = "\003168\003192\007IN-ADDR\004ARPA"; static dns_name_t rfc1918names[] = { - NS_NAME_INIT(inaddr10, inaddr10_offsets), - NS_NAME_INIT(inaddr16172, inaddr172_offsets), - NS_NAME_INIT(inaddr17172, inaddr172_offsets), - NS_NAME_INIT(inaddr18172, inaddr172_offsets), - NS_NAME_INIT(inaddr19172, inaddr172_offsets), - NS_NAME_INIT(inaddr20172, inaddr172_offsets), - NS_NAME_INIT(inaddr21172, inaddr172_offsets), - NS_NAME_INIT(inaddr22172, inaddr172_offsets), - NS_NAME_INIT(inaddr23172, inaddr172_offsets), - NS_NAME_INIT(inaddr24172, inaddr172_offsets), - NS_NAME_INIT(inaddr25172, inaddr172_offsets), - NS_NAME_INIT(inaddr26172, inaddr172_offsets), - NS_NAME_INIT(inaddr27172, inaddr172_offsets), - NS_NAME_INIT(inaddr28172, inaddr172_offsets), - NS_NAME_INIT(inaddr29172, inaddr172_offsets), - NS_NAME_INIT(inaddr30172, inaddr172_offsets), - NS_NAME_INIT(inaddr31172, inaddr172_offsets), - NS_NAME_INIT(inaddr168192, inaddr192_offsets) + DNS_NAME_INITABSOLUTE(inaddr10, inaddr10_offsets), + DNS_NAME_INITABSOLUTE(inaddr16172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr17172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr18172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr19172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr20172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr21172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr22172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr23172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr24172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr25172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr26172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr27172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr28172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr29172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr30172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr31172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr168192, inaddr192_offsets) }; @@ -4050,8 +4042,10 @@ static unsigned char hostmaster_data[] = "\012hostmaster\014root-servers\003org" static unsigned char prisoner_offsets[] = { 0, 9, 14, 18 }; static unsigned char hostmaster_offsets[] = { 0, 11, 24, 28 }; -static dns_name_t prisoner = NS_NAME_INIT(prisoner_data, prisoner_offsets); -static dns_name_t hostmaster = NS_NAME_INIT(hostmaster_data, hostmaster_offsets); +static dns_name_t prisoner = + DNS_NAME_INITABSOLUTE(prisoner_data, prisoner_offsets); +static dns_name_t hostmaster = + DNS_NAME_INITABSOLUTE(hostmaster_data, hostmaster_offsets); static void warn_rfc1918(ns_client_t *client, dns_name_t *fname, dns_rdataset_t *rdataset) { -- 2.10.1.445.g3cdd5d1
From: "Tony Finch" <dot@dotat.at>
Subject: Re: [ISC-Bugs #45433] AutoReply: [PATCH] Use DNS_NAME_INITABSOLUTE() in query.c
CC: "Tony Finch" <dot@dotat.at>
Date: Wed, 21 Jun 2017 18:29:32 +0100
To: "BIND9 Bugs via RT" <bind9-confidential@isc.org>
More places where we can use DNS_NAME_INIT*() macros --- lib/dns/name.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/lib/dns/name.c b/lib/dns/name.c index d99d360..07ad6dc 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -146,34 +146,12 @@ do { \ */ static unsigned char root_ndata[] = { '\0' }; static unsigned char root_offsets[] = { 0 }; - -static dns_name_t root = -{ - DNS_NAME_MAGIC, - root_ndata, 1, 1, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - root_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; - -/* XXXDCL make const? */ +static dns_name_t root = DNS_NAME_INITABSOLUTE(root_ndata, root_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_rootname = &root; -static unsigned char wild_ndata[] = { '\001', '*' }; +static unsigned char wild_ndata[] = "\001*"; static unsigned char wild_offsets[] = { 0 }; - -static dns_name_t wild = -{ - DNS_NAME_MAGIC, - wild_ndata, 2, 1, - DNS_NAMEATTR_READONLY, - wild_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; - -/* XXXDCL make const? */ +static dns_name_t wild =DNS_NAME_INITNONABSOLUTE(wild_ndata, wild_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_wildcardname = &wild; unsigned int -- 2.10.1.445.g3cdd5d1
Date: Wed, 21 Jun 2017 19:05:00 +0100
To: "Tony Finch via RT" <bind9-confidential@isc.org>
From: "Tony Finch" <dot@dotat.at>
Subject: Re: [ISC-Bugs #45433] AutoReply: [PATCH] Use DNS_NAME_INITABSOLUTE() in query.c
More DNS_NAME_INIT*() macro calls --- lib/dns/name.c | 94 ++++++++++++++++------------------------------------------ 1 file changed, 25 insertions(+), 69 deletions(-) diff --git a/lib/dns/name.c b/lib/dns/name.c index 50b47b0..ed00353 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -2546,46 +2546,11 @@ static unsigned char lb_dns_sd_udp_data[] = "\002lb\007_dns-sd\004_udp"; static unsigned char lb_dns_sd_udp_offsets[] = { 0, 3, 11 }; static const dns_name_t dns_sd[] = { - { - DNS_NAME_MAGIC, - b_dns_sd_udp_data, 15, 3, - DNS_NAMEATTR_READONLY, - b_dns_sd_udp_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} - }, - { - DNS_NAME_MAGIC, - db_dns_sd_udp_data, 16, 3, - DNS_NAMEATTR_READONLY, - db_dns_sd_udp_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} - }, - { - DNS_NAME_MAGIC, - r_dns_sd_udp_data, 15, 3, - DNS_NAMEATTR_READONLY, - r_dns_sd_udp_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} - }, - { - DNS_NAME_MAGIC, - dr_dns_sd_udp_data, 16, 3, - DNS_NAMEATTR_READONLY, - dr_dns_sd_udp_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} - }, - { - DNS_NAME_MAGIC, - lb_dns_sd_udp_data, 16, 3, - DNS_NAMEATTR_READONLY, - lb_dns_sd_udp_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} - } + DNS_NAME_INITNONABSOLUTE(b_dns_sd_udp_data, b_dns_sd_udp_offsets), + DNS_NAME_INITNONABSOLUTE(db_dns_sd_udp_data, db_dns_sd_udp_offsets), + DNS_NAME_INITNONABSOLUTE(r_dns_sd_udp_data, r_dns_sd_udp_offsets), + DNS_NAME_INITNONABSOLUTE(dr_dns_sd_udp_data, dr_dns_sd_udp_offsets), + DNS_NAME_INITNONABSOLUTE(lb_dns_sd_udp_data, lb_dns_sd_udp_offsets), }; isc_boolean_t @@ -2604,15 +2569,6 @@ dns_name_isdnssd(const dns_name_t *name) { return (ISC_FALSE); } -#define NS_NAME_INIT(A,B) \ - { \ - DNS_NAME_MAGIC, \ - A, sizeof(A), sizeof(B), \ - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, \ - B, NULL, { (void *)-1, (void *)-1}, \ - {NULL, NULL} \ - } - static unsigned char inaddr10_offsets[] = { 0, 3, 11, 16 }; static unsigned char inaddr172_offsets[] = { 0, 3, 7, 15, 20 }; static unsigned char inaddr192_offsets[] = { 0, 4, 8, 16, 21 }; @@ -2639,24 +2595,24 @@ static unsigned char inaddr31172[] = "\00231\003172\007IN-ADDR\004ARPA"; static unsigned char inaddr168192[] = "\003168\003192\007IN-ADDR\004ARPA"; static dns_name_t const rfc1918names[] = { - NS_NAME_INIT(inaddr10, inaddr10_offsets), - NS_NAME_INIT(inaddr16172, inaddr172_offsets), - NS_NAME_INIT(inaddr17172, inaddr172_offsets), - NS_NAME_INIT(inaddr18172, inaddr172_offsets), - NS_NAME_INIT(inaddr19172, inaddr172_offsets), - NS_NAME_INIT(inaddr20172, inaddr172_offsets), - NS_NAME_INIT(inaddr21172, inaddr172_offsets), - NS_NAME_INIT(inaddr22172, inaddr172_offsets), - NS_NAME_INIT(inaddr23172, inaddr172_offsets), - NS_NAME_INIT(inaddr24172, inaddr172_offsets), - NS_NAME_INIT(inaddr25172, inaddr172_offsets), - NS_NAME_INIT(inaddr26172, inaddr172_offsets), - NS_NAME_INIT(inaddr27172, inaddr172_offsets), - NS_NAME_INIT(inaddr28172, inaddr172_offsets), - NS_NAME_INIT(inaddr29172, inaddr172_offsets), - NS_NAME_INIT(inaddr30172, inaddr172_offsets), - NS_NAME_INIT(inaddr31172, inaddr172_offsets), - NS_NAME_INIT(inaddr168192, inaddr192_offsets) + DNS_NAME_INITABSOLUTE(inaddr10, inaddr10_offsets), + DNS_NAME_INITABSOLUTE(inaddr16172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr17172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr18172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr19172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr20172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr21172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr22172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr23172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr24172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr25172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr26172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr27172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr28172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr29172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr30172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr31172, inaddr172_offsets), + DNS_NAME_INITABSOLUTE(inaddr168192, inaddr192_offsets) }; isc_boolean_t @@ -2674,8 +2630,8 @@ static unsigned char ip6fc[] = "\001c\001f\003ip6\004ARPA"; static unsigned char ip6fd[] = "\001d\001f\003ip6\004ARPA"; static dns_name_t const ulanames[] = { - NS_NAME_INIT(ip6fc, ulaoffsets), - NS_NAME_INIT(ip6fd, ulaoffsets), + DNS_NAME_INITABSOLUTE(ip6fc, ulaoffsets), + DNS_NAME_INITABSOLUTE(ip6fd, ulaoffsets), }; isc_boolean_t -- 2.10.1.445.g3cdd5d1
To: "Tony Finch via RT" <bind9-confidential@isc.org>
CC: "Tony Finch" <dot@dotat.at>
Date: Wed, 21 Jun 2017 19:20:36 +0100
Subject: Re: [ISC-Bugs #45433] [PATCH] Use DNS_NAME_INITABSOLUTE()
From: "Tony Finch" <dot@dotat.at>
Last lot of DNS_NAME_INIT*() macro calls --- lib/dns/master.c | 27 ++----------- lib/dns/rdata.c | 11 +----- lib/dns/rdata/generic/ptr_12.c | 27 ++----------- lib/dns/tsig.c | 88 +++++++++--------------------------------- 4 files changed, 26 insertions(+), 127 deletions(-) diff --git a/lib/dns/master.c b/lib/dns/master.c index 6e983c6..4075bc5 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -323,38 +323,17 @@ loadctx_destroy(dns_loadctx_t *lctx); static unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA"; static unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 }; static const dns_name_t in_addr_arpa = -{ - DNS_NAME_MAGIC, - in_addr_arpa_data, 14, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - in_addr_arpa_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; + DNS_NAME_INITABSOLUTE(in_addr_arpa_data, in_addr_arpa_offsets); static unsigned char ip6_int_data[] = "\003IP6\003INT"; static unsigned char ip6_int_offsets[] = { 0, 4, 8 }; static const dns_name_t ip6_int = -{ - DNS_NAME_MAGIC, - ip6_int_data, 9, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - ip6_int_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; + DNS_NAME_INITABSOLUTE(ip6_int_data, ip6_int_offsets); static unsigned char ip6_arpa_data[] = "\003IP6\004ARPA"; static unsigned char ip6_arpa_offsets[] = { 0, 4, 9 }; static const dns_name_t ip6_arpa = -{ - DNS_NAME_MAGIC, - ip6_arpa_data, 10, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - ip6_arpa_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; + DNS_NAME_INITABSOLUTE(ip6_arpa_data, ip6_arpa_offsets); static inline isc_result_t gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *token, diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 5cc4b58..37519d2 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -312,15 +312,8 @@ generic_freestruct_tlsa(ARGS_FREESTRUCT); */ static unsigned char gc_msdcs_data[] = "\002gc\006_msdcs"; static unsigned char gc_msdcs_offset [] = { 0, 3 }; - -static const dns_name_t gc_msdcs = { - DNS_NAME_MAGIC, - gc_msdcs_data, 10, 2, - DNS_NAMEATTR_READONLY, - gc_msdcs_offset, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static const dns_name_t gc_msdcs = + DNS_NAME_INITNONABSOLUTE(gc_msdcs_data, gc_msdcs_offset); /*% * convert presentation level address to network order binary form. diff --git a/lib/dns/rdata/generic/ptr_12.c b/lib/dns/rdata/generic/ptr_12.c index 652e3df..7e56f29 100644 --- a/lib/dns/rdata/generic/ptr_12.c +++ b/lib/dns/rdata/generic/ptr_12.c @@ -222,38 +222,17 @@ checkowner_ptr(ARGS_CHECKOWNER) { static unsigned char ip6_arpa_data[] = "\003IP6\004ARPA"; static unsigned char ip6_arpa_offsets[] = { 0, 4, 9 }; static const dns_name_t ip6_arpa = -{ - DNS_NAME_MAGIC, - ip6_arpa_data, 10, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - ip6_arpa_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; + DNS_NAME_INITABSOLUTE(ip6_arpa_data, ip6_arpa_offsets); static unsigned char ip6_int_data[] = "\003IP6\003INT"; static unsigned char ip6_int_offsets[] = { 0, 4, 8 }; static const dns_name_t ip6_int = -{ - DNS_NAME_MAGIC, - ip6_int_data, 9, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - ip6_int_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; + DNS_NAME_INITABSOLUTE(ip6_int_data, ip6_int_offsets); static unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA"; static unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 }; static const dns_name_t in_addr_arpa = -{ - DNS_NAME_MAGIC, - in_addr_arpa_data, 14, 3, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - in_addr_arpa_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; + DNS_NAME_INITABSOLUTE(in_addr_arpa_data, in_addr_arpa_offsets); static inline isc_boolean_t checknames_ptr(ARGS_CHECKNAMES) { diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index 400efe9..222c6ab 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -72,29 +72,17 @@ #ifndef PK11_MD5_DISABLE static unsigned char hmacmd5_ndata[] = "\010hmac-md5\007sig-alg\003reg\003int"; static unsigned char hmacmd5_offsets[] = { 0, 9, 17, 21, 25 }; - -static dns_name_t hmacmd5 = { - DNS_NAME_MAGIC, - hmacmd5_ndata, 26, 5, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - hmacmd5_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t hmacmd5 = + DNS_NAME_INITABSOLUTE(hmacmd5_ndata, hmacmd5_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_hmacmd5_name = &hmacmd5; #endif static unsigned char gsstsig_ndata[] = "\010gss-tsig"; static unsigned char gsstsig_offsets[] = { 0, 9 }; -static dns_name_t gsstsig = { - DNS_NAME_MAGIC, - gsstsig_ndata, 10, 2, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - gsstsig_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t gsstsig = + DNS_NAME_INITABSOLUTE(gsstsig_ndata, gsstsig_offsets); + LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_gssapi_name = &gsstsig; /* @@ -103,83 +91,43 @@ LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_gssapi_name = &gsstsig; */ static unsigned char gsstsigms_ndata[] = "\003gss\011microsoft\003com"; static unsigned char gsstsigms_offsets[] = { 0, 4, 14, 18 }; -static dns_name_t gsstsigms = { - DNS_NAME_MAGIC, - gsstsigms_ndata, 19, 4, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - gsstsigms_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t gsstsigms = + DNS_NAME_INITABSOLUTE(gsstsigms_ndata, gsstsigms_offsets); + LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_gssapims_name = &gsstsigms; static unsigned char hmacsha1_ndata[] = "\011hmac-sha1"; static unsigned char hmacsha1_offsets[] = { 0, 10 }; - -static dns_name_t hmacsha1 = { - DNS_NAME_MAGIC, - hmacsha1_ndata, 11, 2, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - hmacsha1_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t hmacsha1 = + DNS_NAME_INITABSOLUTE(hmacsha1_ndata, hmacsha1_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_hmacsha1_name = &hmacsha1; static unsigned char hmacsha224_ndata[] = "\013hmac-sha224"; static unsigned char hmacsha224_offsets[] = { 0, 12 }; - -static dns_name_t hmacsha224 = { - DNS_NAME_MAGIC, - hmacsha224_ndata, 13, 2, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - hmacsha224_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t hmacsha224 = + DNS_NAME_INITABSOLUTE(hmacsha224_ndata, hmacsha224_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_hmacsha224_name = &hmacsha224; static unsigned char hmacsha256_ndata[] = "\013hmac-sha256"; static unsigned char hmacsha256_offsets[] = { 0, 12 }; - -static dns_name_t hmacsha256 = { - DNS_NAME_MAGIC, - hmacsha256_ndata, 13, 2, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - hmacsha256_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t hmacsha256 = + DNS_NAME_INITABSOLUTE(hmacsha256_ndata, hmacsha256_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_hmacsha256_name = &hmacsha256; static unsigned char hmacsha384_ndata[] = "\013hmac-sha384"; static unsigned char hmacsha384_offsets[] = { 0, 12 }; - -static dns_name_t hmacsha384 = { - DNS_NAME_MAGIC, - hmacsha384_ndata, 13, 2, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - hmacsha384_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t hmacsha384 = + DNS_NAME_INITABSOLUTE(hmacsha384_ndata, hmacsha384_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_hmacsha384_name = &hmacsha384; static unsigned char hmacsha512_ndata[] = "\013hmac-sha512"; static unsigned char hmacsha512_offsets[] = { 0, 12 }; - -static dns_name_t hmacsha512 = { - DNS_NAME_MAGIC, - hmacsha512_ndata, 13, 2, - DNS_NAMEATTR_READONLY | DNS_NAMEATTR_ABSOLUTE, - hmacsha512_offsets, NULL, - {(void *)-1, (void *)-1}, - {NULL, NULL} -}; +static dns_name_t hmacsha512 = + DNS_NAME_INITABSOLUTE(hmacsha512_ndata, hmacsha512_offsets); LIBDNS_EXTERNAL_DATA const dns_name_t *dns_tsig_hmacsha512_name = &hmacsha512; -- 2.10.1.445.g3cdd5d1
Hi Tony, Thank you for this patch. We discussed this patch in the BIND development team and agreed to accept it, and to integrate it into all versions (so backport to supported branches). We will try to commit it between the 9.12 alpha and beta. Vicky
4817. [cleanup] Use DNS_NAME_INITABSOLUTE and DNS_NAME_INITNONABSOLUTE. [RT #45433]
From: "Tony Finch" <dot@dotat.at>
Subject: Re: [ISC-Bugs #45433] [PATCH] Use DNS_NAME_INITABSOLUTE() in query.c
To: "Mark Andrews via RT" <bind9-public@isc.org>
CC: "Tony Finch" <dot@dotat.at>
Date: Mon, 13 Nov 2017 12:17:01 +0000
Thanks! I still have a few diffs remaining in my version of this change, mainly in lib/dns/rdata/generic/ptr_12.c but also one remaining incorrect XXXDCL comment in lib/dns/name.c https://git.uis.cam.ac.uk/x/uis/ipreg/bind9.git/commitdiff/514b841cab786859a85dd936361c2717b5938d22 Tony. -- f.anthony.n.finch <dot@dotat.at> http://dotat.at/ - I xn--zr8h punycode Trafalgar: Northerly or northeasterly 4 or 5, increasing 6 at times. Moderate or rough, occasionally slight in southeast. Fair. Good.
On Mon Nov 13 02:17:10 2017, dot@dotat.at wrote: > Thanks! > > I still have a few diffs remaining in my version of this change, > mainly in > lib/dns/rdata/generic/ptr_12.c but also one remaining incorrect XXXDCL > comment in lib/dns/name.c > > https://git.uis.cam.ac.uk/x/uis/ipreg/bind9.git/commitdiff/514b841cab786859a85dd936361c2717b5938d22 > > Tony. Thanks "grep -r DNS_NAME_MAGIC lib bin" through up a additional instance in dig.c which I also addressed.