summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorInternet Software Consortium, Inc <@isc.org>2012-10-29 07:26:48 -0600
committerInternet Software Consortium, Inc <@isc.org>2012-10-29 07:26:48 -0600
commitc450e7bf1c721a84ef09d825e79cf998159decc0 (patch)
tree5e81f6689a7294e8715a78fb2cc1dcd97372cf55 /bin
parent0521fcef31b7ebc73927d77730f6ca8c4833ace1 (diff)
downloadbind9-c450e7bf1c721a84ef09d825e79cf998159decc0.tar.gz
9.9.1-P4
Diffstat (limited to 'bin')
-rw-r--r--bin/named/query.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/bin/named/query.c b/bin/named/query.c
index abf28eee..291d7f60 100644
--- a/bin/named/query.c
+++ b/bin/named/query.c
@@ -1119,13 +1119,6 @@ query_isduplicate(ns_client_t *client, dns_name_t *name,
mname = NULL;
}
- /*
- * If the dns_name_t we're looking up is already in the message,
- * we don't want to trigger the caller's name replacement logic.
- */
- if (name == mname)
- mname = NULL;
-
if (mnamep != NULL)
*mnamep = mname;
@@ -1330,6 +1323,7 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
if (dns_rdataset_isassociated(rdataset) &&
!query_isduplicate(client, fname, type, &mname)) {
if (mname != NULL) {
+ INSIST(mname != fname);
query_releasename(client, &fname);
fname = mname;
} else
@@ -1399,11 +1393,13 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
#endif
if (!query_isduplicate(client, fname,
dns_rdatatype_a, &mname)) {
- if (mname != NULL) {
- query_releasename(client, &fname);
- fname = mname;
- } else
- need_addname = ISC_TRUE;
+ if (mname != fname) {
+ if (mname != NULL) {
+ query_releasename(client, &fname);
+ fname = mname;
+ } else
+ need_addname = ISC_TRUE;
+ }
ISC_LIST_APPEND(fname->list, rdataset, link);
added_something = ISC_TRUE;
if (sigrdataset != NULL &&
@@ -1456,11 +1452,13 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
#endif
if (!query_isduplicate(client, fname,
dns_rdatatype_aaaa, &mname)) {
- if (mname != NULL) {
- query_releasename(client, &fname);
- fname = mname;
- } else
- need_addname = ISC_TRUE;
+ if (mname != fname) {
+ if (mname != NULL) {
+ query_releasename(client, &fname);
+ fname = mname;
+ } else
+ need_addname = ISC_TRUE;
+ }
ISC_LIST_APPEND(fname->list, rdataset, link);
added_something = ISC_TRUE;
if (sigrdataset != NULL &&
@@ -1991,22 +1989,24 @@ query_addadditional2(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
crdataset->type == dns_rdatatype_aaaa) {
if (!query_isduplicate(client, fname, crdataset->type,
&mname)) {
- if (mname != NULL) {
- /*
- * A different type of this name is
- * already stored in the additional
- * section. We'll reuse the name.
- * Note that this should happen at most
- * once. Otherwise, fname->link could
- * leak below.
- */
- INSIST(mname0 == NULL);
-
- query_releasename(client, &fname);
- fname = mname;
- mname0 = mname;
- } else
- need_addname = ISC_TRUE;
+ if (mname != fname) {
+ if (mname != NULL) {
+ /*
+ * A different type of this name is
+ * already stored in the additional
+ * section. We'll reuse the name.
+ * Note that this should happen at most
+ * once. Otherwise, fname->link could
+ * leak below.
+ */
+ INSIST(mname0 == NULL);
+
+ query_releasename(client, &fname);
+ fname = mname;
+ mname0 = mname;
+ } else
+ need_addname = ISC_TRUE;
+ }
ISC_LIST_UNLINK(cfname.list, crdataset, link);
ISC_LIST_APPEND(fname->list, crdataset, link);
added_something = ISC_TRUE;