--- /dev/null
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+rm -f */named.memstats
+rm -f */named.run
+rm -f */named.conf
+rm -f dig.out.test*
+rm -f ns2/example.com.bk
+rm -f ns2/example.net.bk
--- /dev/null
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0. If a copy of the MPL was not distributed with this
+; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL 300 ; 5 minutes
+@ IN SOA ns root (
+ 2018010100 ; serial
+ 1800 ; refresh (30 minutes)
+ 1800 ; retry (30 minutes)
+ 1814400 ; expire (3 weeks)
+ 3600 ; minimum (1 hour)
+ )
+ NS ns
+ns A 10.53.0.1
+a A 10.53.0.1
+
+aname-both ANAME fake-aname-target.
+aname-both A 192.0.2.1
+aname-both AAAA 2001:db8::a
+
+aname-a ANAME fake-aname-target.
+aname-a A 192.0.2.2
+
+aname-aaaa ANAME fake-aname-target.
+aname-aaaa AAAA 2001:db8::b
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+ query-source address 10.53.0.1;
+ notify-source 10.53.0.1;
+ transfer-source 10.53.0.1;
+ port @PORT@;
+ pid-file "named.pid";
+ listen-on { 10.53.0.1; };
+ listen-on-v6 { none; };
+ recursion no;
+ notify yes;
+};
+
+zone example {
+ type master;
+ file "example.db";
+};
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+ query-source address 10.53.0.1;
+ notify-source 10.53.0.1;
+ transfer-source 10.53.0.1;
+ port @PORT@;
+ pid-file "named.pid";
+ listen-on { 10.53.0.1; };
+ listen-on-v6 { none; };
+ recursion no;
+ notify yes;
+ minimal-responses yes;
+};
+
+zone example {
+ type master;
+ file "example.db";
+};
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+ query-source address 10.53.0.1;
+ notify-source 10.53.0.1;
+ transfer-source 10.53.0.1;
+ port @PORT@;
+ pid-file "named.pid";
+ listen-on { 10.53.0.1; };
+ listen-on-v6 { none; };
+ recursion no;
+ notify yes;
+ minimal-responses no;
+};
+
+zone example {
+ type master;
+ file "example.db";
+};
--- /dev/null
+#!/bin/sh
+#
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+SYSTEMTESTTOP=..
+. $SYSTEMTESTTOP/conf.sh
+
+$SHELL clean.sh
+
+copy_setports ns1/named1.conf.in ns1/named.conf
--- /dev/null
+#!/bin/sh
+#
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+SYSTEMTESTTOP=..
+. $SYSTEMTESTTOP/conf.sh
+
+DIGOPTS="+tcp -p ${PORT}"
+RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
+
+status=0
+n=0
+
+echo_i "minimal responses: default"
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns A and AAAA (if both are present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-both.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 3" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
+grep "2001:db8::a" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns A (if only A present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-a.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 2" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "192.0.2.2" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns AAAA (if only AAAA present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-aaaa.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 2" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "2001:db8::b" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+copy_setports ns1/named2.conf.in ns1/named.conf
+$RNDCCMD 10.53.0.1 reconfig 2>&1 | sed 's/^/ns1 /' | cat_i
+
+echo_i "minimal responses: yes"
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns A and AAAA (if both are present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-both.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 3" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
+grep "2001:db8::a" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns A (if only A present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-a.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 2" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "192.0.2.2" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns AAAA (if only AAAA present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-aaaa.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 2" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "2001:db8::b" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+copy_setports ns1/named3.conf.in ns1/named.conf
+$RNDCCMD 10.53.0.1 reconfig 2>&1 | sed 's/^/ns1 /' | cat_i
+
+echo_i "minimal responses: no"
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns A and AAAA (if both are present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-both.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 3" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "192.0.2.1" dig.out.test$n > /dev/null || ret=1
+grep "2001:db8::a" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns A (if only A present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-a.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 2" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "192.0.2.2" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "check that ANAME query returns AAAA (if only AAAA present) in additional ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.1 aname-aaaa.example aname > dig.out.test$n || ret=1
+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
+grep "ADDITIONAL: 2" dig.out.test$n > /dev/null || ret=1
+grep "flags:.*aa" dig.out.test$n > /dev/null || ret=1
+grep "2001:db8::b" dig.out.test$n > /dev/null || ret=1
+[ $ret -eq 0 ] || echo_i "failed"
+status=`expr $status + $ret`
+
+echo_i "exit status: $status"
+[ $status -eq 0 ] || exit 1
# test, these tests can be run in parallel.
#
# This symbol must be kept in step with the PARALLEL macro in Makefile.in
-PARALLELDIRS="acl additional addzone allow-query auth autosign \
+PARALLELDIRS="acl additional addzone allow-query aname auth autosign \
builtin cacheclean case catz cds chain \
checkconf checknames checkzone \
@CHECKDS@ @COVERAGE@ @KEYMGR@ \
fetchlimit filter-aaaa formerr forward \
geoip glue inline integrity ixfr keepalive \
legacy limits logfileconfig \
- masterfile masterformat metadata mkeys \
- names notify nslookup nsupdate nzd2nzf \
- padding pending pipelined \
- reclimit redirect resolver rndc rpz rpzrecurse \
- rrchecker rrl rrsetorder rsabigexponent runtime \
- serve-stale sfcache smartsign sortlist \
- spf staticstub statistics statschannel stub synthfromdnssec \
- tcp tools tsig tsiggss \
- unknown upforwd verify views wildcard \
- xfer xferquota zero zonechecks"
+ masterfile masterformat metadata mkeys \
+ names notify nslookup nsupdate nzd2nzf \
+ padding pending pipelined \
+ reclimit redirect resolver rndc rpz rpzrecurse \
+ rrchecker rrl rrsetorder rsabigexponent runtime \
+ serve-stale sfcache smartsign sortlist \
+ spf staticstub statistics statschannel stub synthfromdnssec \
+ tcp tools tsig tsiggss \
+ unknown upforwd verify views wildcard \
+ xfer xferquota zero zonechecks"
SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS"
fi
if grep "^#define WANT_IPV6 1" $TOP/config.h > /dev/null 2>&1 ; then
- TESTSOCK6="$TESTSOCK6"
+ TESTSOCK6="$TESTSOCK6"
else
- TESTSOCK6=false
+ TESTSOCK6=false
fi
# Windows process management leave empty
[ -f $1.prev ] || echo "0" > $1.prev
prev=`cat $1.prev`
awk "NR > $prev "'{ print }
- END { print NR > "/dev/stderr" }' $1 2> $1.prev
+ END { print NR > "/dev/stderr" }' $1 2> $1.prev
}
# copy_setports - Copy Configuration File and Replace Ports
copy_setports() {
sed -e "s/@PORT@/${PORT}/g" \
- -e "s/@EXTRAPORT1@/${EXTRAPORT1}/g" \
- -e "s/@EXTRAPORT2@/${EXTRAPORT2}/g" \
- -e "s/@EXTRAPORT3@/${EXTRAPORT3}/g" \
- -e "s/@EXTRAPORT4@/${EXTRAPORT4}/g" \
- -e "s/@EXTRAPORT5@/${EXTRAPORT5}/g" \
- -e "s/@EXTRAPORT6@/${EXTRAPORT6}/g" \
- -e "s/@EXTRAPORT7@/${EXTRAPORT7}/g" \
- -e "s/@EXTRAPORT8@/${EXTRAPORT8}/g" \
- -e "s/@CONTROLPORT@/${CONTROLPORT}/g" $1 > $2
+ -e "s/@EXTRAPORT1@/${EXTRAPORT1}/g" \
+ -e "s/@EXTRAPORT2@/${EXTRAPORT2}/g" \
+ -e "s/@EXTRAPORT3@/${EXTRAPORT3}/g" \
+ -e "s/@EXTRAPORT4@/${EXTRAPORT4}/g" \
+ -e "s/@EXTRAPORT5@/${EXTRAPORT5}/g" \
+ -e "s/@EXTRAPORT6@/${EXTRAPORT6}/g" \
+ -e "s/@EXTRAPORT7@/${EXTRAPORT7}/g" \
+ -e "s/@EXTRAPORT8@/${EXTRAPORT8}/g" \
+ -e "s/@CONTROLPORT@/${CONTROLPORT}/g" $1 > $2
}
#
#
# List of tests that use ports 5300 and 9953. For this reason, these must
# be run sequentially.
-SEQUENTIALDIRS="acl additional addzone autosign builtin \
- cacheclean case \
- checkconf @CHECKDS@ checknames checkzone cookie @COVERAGE@ \
- database digdelv dlv dlvauto dlz dlzexternal dname \
- dns64 dnssec @DNSTAP@ dscp dsdigest dyndb ecdsa eddsa \
- ednscompliance emptyzones \
- fetchlimit filter-aaaa formerr forward geoip glue gost inline ixfr \
- keepalive @KEYMGR@ legacy limits logfileconfig masterfile \
- masterformat metadata mkeys names notify nslookup nsupdate \
- nzd2nzf padding pending pipelined @PKCS11_TEST@ reclimit \
- redirect resolver rndc rpz rrchecker rrl \
- rrsetorder rsabigexponent runtime sfcache smartsign sortlist \
- spf staticstub statistics statschannel stub tcp tkey tsig \
- tsiggss unknown upforwd verify views wildcard xfer xferquota \
- zero zonechecks"
-
-# List of tests that use unique ports (other than 5300 and 9953). These
-# tests can be run in parallel.
+SEQUENTIALDIRS="ecdsa eddsa gost @PKCS11_TEST@ tkey"
+
+# List of tests that use ports assigned by caller (other than 5300
+# and 9953). Because separate blocks of ports can be used for teach
+# test, these tests can be run in parallel.
#
# This symbol must be kept in step with the PARALLEL macro in Makefile.in
-PARALLELDIRS="allow_query catz rpzrecurse serve-stale"
+PARALLELDIRS="acl additional addzone allow-query aname auth autosign \
+ builtin cacheclean case catz cds chain \
+ checkconf checknames checkzone \
+ @CHECKDS@ @COVERAGE@ @KEYMGR@ \
+ cookie database digdelv dlv dlz dlzexternal \
+ dns64 dnssec @DNSTAP@ dscp dsdigest dyndb \
+ ednscompliance emptyzones \
+ fetchlimit filter-aaaa formerr forward \
+ geoip glue inline integrity ixfr keepalive \
+ legacy limits logfileconfig \
+ masterfile masterformat metadata mkeys \
+ names notify nslookup nsupdate nzd2nzf \
+ padding pending pipelined \
+ reclimit redirect resolver rndc rpz rpzrecurse \
+ rrchecker rrl rrsetorder rsabigexponent runtime \
+ serve-stale sfcache smartsign sortlist \
+ spf staticstub statistics statschannel stub synthfromdnssec \
+ tcp tools tsig tsiggss \
+ unknown upforwd verify views wildcard \
+ xfer xferquota zero zonechecks"
SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS"
fi
if grep "^#define WANT_IPV6 1" $TOP/config.h > /dev/null 2>&1 ; then
- TESTSOCK6="$TESTSOCK6"
+ TESTSOCK6="$TESTSOCK6"
else
- TESTSOCK6=false
+ TESTSOCK6=false
fi
#
fi
echofail () {
- printf "${COLOR_FAIL}%s${COLOR_NONE}\n" "$*"
+ printf "${COLOR_FAIL}%s${COLOR_NONE}\n" "$*"
}
echowarn () {
- printf "${COLOR_WARN}%s${COLOR_NONE}\n" "$*"
+ printf "${COLOR_WARN}%s${COLOR_NONE}\n" "$*"
}
echopass () {
- printf "${COLOR_PASS}%s${COLOR_NONE}\n" "$*"
+ printf "${COLOR_PASS}%s${COLOR_NONE}\n" "$*"
}
echoinfo () {
- printf "${COLOR_INFO}%s${COLOR_NONE}\n" "$*"
+ printf "${COLOR_INFO}%s${COLOR_NONE}\n" "$*"
}
echostart () {
- printf "${COLOR_START}%s${COLOR_NONE}\n" "$*"
+ printf "${COLOR_START}%s${COLOR_NONE}\n" "$*"
}
echoend () {
- printf "${COLOR_END}%s${COLOR_NONE}\n" "$*"
+ printf "${COLOR_END}%s${COLOR_NONE}\n" "$*"
}
TESTNAME="`basename $PWD`"
[ -f $1.prev ] || echo "0" > $1.prev
prev=`cat $1.prev`
awk "NR > $prev "'{ print }
- END { print NR > "/dev/stderr" }' $1 2> $1.prev
+ END { print NR > "/dev/stderr" }' $1 2> $1.prev
}
# copy_setports - Copy Configuration File and Replace Ports
# tokens when it processes this file and produces conf.sh.
atsign="@"
sed -e "s/${atsign}PORT${atsign}/${PORT}/g" \
- -e "s/${atsign}EXTRAPORT1${atsign}/${EXTRAPORT1}/g" \
- -e "s/${atsign}EXTRAPORT2${atsign}/${EXTRAPORT2}/g" \
- -e "s/${atsign}EXTRAPORT3${atsign}/${EXTRAPORT3}/g" \
- -e "s/${atsign}EXTRAPORT4${atsign}/${EXTRAPORT4}/g" \
- -e "s/${atsign}EXTRAPORT5${atsign}/${EXTRAPORT5}/g" \
- -e "s/${atsign}EXTRAPORT6${atsign}/${EXTRAPORT6}/g" \
- -e "s/${atsign}EXTRAPORT7${atsign}/${EXTRAPORT7}/g" \
- -e "s/${atsign}EXTRAPORT8${atsign}/${EXTRAPORT8}/g" \
- -e "s/${atsign}CONTROLPORT${atsign}/${CONTROLPORT}/g" $1 > $2
+ -e "s/${atsign}EXTRAPORT1${atsign}/${EXTRAPORT1}/g" \
+ -e "s/${atsign}EXTRAPORT2${atsign}/${EXTRAPORT2}/g" \
+ -e "s/${atsign}EXTRAPORT3${atsign}/${EXTRAPORT3}/g" \
+ -e "s/${atsign}EXTRAPORT4${atsign}/${EXTRAPORT4}/g" \
+ -e "s/${atsign}EXTRAPORT5${atsign}/${EXTRAPORT5}/g" \
+ -e "s/${atsign}EXTRAPORT6${atsign}/${EXTRAPORT6}/g" \
+ -e "s/${atsign}EXTRAPORT7${atsign}/${EXTRAPORT7}/g" \
+ -e "s/${atsign}EXTRAPORT8${atsign}/${EXTRAPORT8}/g" \
+ -e "s/${atsign}CONTROLPORT${atsign}/${CONTROLPORT}/g" $1 > $2
}
#
static inline isc_result_t
additionaldata_aname(ARGS_ADDLDATA) {
- UNUSED(rdata);
- UNUSED(add);
- UNUSED(arg);
-
REQUIRE(rdata->type == dns_rdatatype_aname);
- return (ISC_R_SUCCESS);
+ return ((add)(arg, dns_rootname, dns_rdatatype_aname));
}
static inline isc_result_t
#define NS_QUERYATTR_DNS64EXCLUDE 0x8000
#define NS_QUERYATTR_RRL_CHECKED 0x10000
#define NS_QUERYATTR_REDIRECT 0x20000
+#define NS_QUERYATTR_ANAME 0x40000
/* query context structure */
#define STALE(r) (((r)->attributes & \
DNS_RDATASETATTR_STALE) != 0)
+#define ANAME(c) (((c)->query.attributes & \
+ NS_QUERYATTR_ANAME) != 0)
+
#ifdef WANT_QUERYTRACE
static inline void
client_trace(ns_client_t *client, int level, const char *message) {
static isc_result_t
query_addadditional(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
ns_client_t *client = arg;
- isc_result_t result, eresult;
- dns_dbnode_t *node;
- dns_db_t *db;
- dns_name_t *fname, *mname;
- dns_rdataset_t *rdataset, *sigrdataset, *trdataset;
- isc_buffer_t *dbuf;
+ isc_result_t result, eresult = ISC_R_SUCCESS;
+ dns_dbnode_t *node = NULL;
+ dns_db_t *db = NULL;
+ dns_name_t *fname = NULL, *mname = NULL;
+ dns_rdataset_t *rdataset = NULL, *sigrdataset = NULL;
+ dns_rdataset_t *trdataset = NULL;
+ isc_buffer_t *dbuf = NULL;
isc_buffer_t b;
- ns_dbversion_t *dbversion;
- dns_dbversion_t *version;
- isc_boolean_t added_something, need_addname;
+ ns_dbversion_t *dbversion = NULL;
+ dns_dbversion_t *version = NULL;
+ isc_boolean_t added_something = ISC_FALSE;
+ isc_boolean_t need_addname = ISC_FALSE;
dns_rdatatype_t type;
dns_clientinfomethods_t cm;
dns_clientinfo_t ci;
- dns_rdatasetadditional_t additionaltype;
+ dns_rdatasetadditional_t additionaltype =
+ dns_rdatasetadditional_fromauth;
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(qtype != dns_rdatatype_any);
+
if (!WANTDNSSEC(client) && dns_rdatatype_isdnssec(qtype))
return (ISC_R_SUCCESS);
CTRACE(ISC_LOG_DEBUG(3), "query_addadditional");
- /*
- * Initialization.
- */
- eresult = ISC_R_SUCCESS;
- fname = NULL;
- rdataset = NULL;
- sigrdataset = NULL;
- trdataset = NULL;
- db = NULL;
- version = NULL;
- node = NULL;
- added_something = ISC_FALSE;
- need_addname = ISC_FALSE;
- additionaltype = dns_rdatasetadditional_fromauth;
-
dns_clientinfomethods_init(&cm, ns_client_sourceip);
dns_clientinfo_init(&ci, client, NULL);
+ if (qtype == dns_rdatatype_aname) {
+ client->query.attributes |= NS_QUERYATTR_ANAME;
+ return (query_addadditional(arg, client->query.qname,
+ dns_rdatatype_a));
+ }
+
/*
* We treat type A additional section processing as if it
* were "any address type" additional section processing.
* To avoid multiple lookups, we do an 'any' database
* lookup and iterate over the node.
*/
- if (qtype == dns_rdatatype_a)
+ if (qtype == dns_rdatatype_a) {
type = dns_rdatatype_any;
- else
+ } else {
type = qtype;
+ }
/*
* Get some resources.
}
/*
- * If we want only minimal responses and are here, then it must
+ * If we want only jinimal responses and are here, then it must
* be for glue.
*/
- if (client->view->minimalresponses == dns_minimal_yes)
+ if (client->view->minimalresponses == dns_minimal_yes &&
+ !ANAME(client))
+ {
goto try_glue;
+ }
/*
* Look within the same zone database for authoritative
cleanup:
CTRACE(ISC_LOG_DEBUG(3), "query_addadditional: cleanup");
+ if (ANAME(client)) {
+ client->query.attributes &= ~NS_QUERYATTR_ANAME;
+ }
query_putrdataset(client, &rdataset);
- if (sigrdataset != NULL)
+ if (sigrdataset != NULL) {
query_putrdataset(client, &sigrdataset);
- if (fname != NULL)
+ }
+ if (fname != NULL) {
query_releasename(client, &fname);
- if (node != NULL)
+ }
+ if (node != NULL) {
dns_db_detachnode(db, &node);
- if (db != NULL)
+ }
+ if (db != NULL) {
dns_db_detach(&db);
+ }
CTRACE(ISC_LOG_DEBUG(3), "query_addadditional: done");
return (eresult);
rdataset->rdclass);
rdataset->attributes |= DNS_RDATASETATTR_LOADORDER;
- if (NOADDITIONAL(client))
+ if (NOADDITIONAL(client) && rdataset->type != dns_rdatatype_aname) {
return;
+ }
/*
* Try to process glue directly.