From: "Tony Finch" Subject: Re: [ISC-Bugs #45433] AutoReply: [PATCH] Use DNS_NAME_INITABSOLUTE() in query.c content-type: TEXT/PLAIN; charset="utf-8" Received: from mx.pao1.isc.org (mx.pao1.isc.org [149.20.64.53]) by bugs.isc.org (Postfix) with ESMTP id 149B7D78A7C for ; Wed, 21 Jun 2017 17:29:39 +0000 (UTC) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.pao1.isc.org (Postfix) with ESMTPS id A7274349480 for ; Wed, 21 Jun 2017 17:29:36 +0000 (UTC) Received: from grey.csi.cam.ac.uk ([131.111.57.57]:54024) by ppsw-30.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.136]:25) with esmtps (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1dNjRd-000lUG-dR (Exim 4.89) (return-path ); Wed, 21 Jun 2017 18:29:33 +0100 Return-Path: X-Cam-Antivirus: no malware found CC: "Tony Finch" Date: Wed, 21 Jun 2017 18:29:32 +0100 Delivered-To: bind9-confidential@bugs.isc.org Message-ID: From dot@dotat.at Wed Jun 21 17:29:39 2017 In-Reply-To: To: "BIND9 Bugs via RT" X-RT-Incoming-Encryption: Not encrypted MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 X-Original-To: bind9-confidential@bugs.isc.org X-Cam-Scannerinfo: http://help.uis.cam.ac.uk/email-scanner-virus References: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.pao1.isc.org User-Agent: Alpine 2.11 (DEB 23 2013-08-11) X-RT-Original-Encoding: utf-8 X-RT-Interface: Email RT-Message-ID: Content-Length: 1277 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