Commit f3139b9d authored by Mark Andrews's avatar Mark Andrews

2187. [bug] query_addds(), query_addwildcardproof() and

                        query_addnxrrsetnsec() should take a version
                        arguement. [RT #16368]
parent 30753c75
2187. [bug] query_addds(), query_addwildcardproof() and
query_addnxrrsetnsec() should take a version
arguement. [RT #16368]
2186. [port] cygwin: libbind: check for struct sockaddr_storage
independently of IPv6. [RT #16482]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.295 2007/04/30 01:02:53 marka Exp $ */
/* $Id: query.c,v 1.296 2007/05/18 06:53:01 marka Exp $ */
/*! \file */
......@@ -2593,7 +2593,9 @@ query_addbestns(ns_client_t *client) {
}
static void
query_addds(ns_client_t *client, dns_db_t *db, dns_dbnode_t *node) {
query_addds(ns_client_t *client, dns_db_t *db, dns_dbnode_t *node,
dns_dbversion_t *version)
{
dns_name_t *rname;
dns_rdataset_t *rdataset, *sigrdataset;
isc_result_t result;
......@@ -2614,12 +2616,12 @@ query_addds(ns_client_t *client, dns_db_t *db, dns_dbnode_t *node) {
/*
* Look for the DS record, which may or may not be present.
*/
result = dns_db_findrdataset(db, node, NULL, dns_rdatatype_ds, 0,
result = dns_db_findrdataset(db, node, version, dns_rdatatype_ds, 0,
client->now, rdataset, sigrdataset);
/*
* If we didn't find it, look for an NSEC. */
if (result == ISC_R_NOTFOUND)
result = dns_db_findrdataset(db, node, NULL,
result = dns_db_findrdataset(db, node, version,
dns_rdatatype_nsec, 0, client->now,
rdataset, sigrdataset);
if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND)
......@@ -2658,7 +2660,8 @@ query_addds(ns_client_t *client, dns_db_t *db, dns_dbnode_t *node) {
static void
query_addwildcardproof(ns_client_t *client, dns_db_t *db,
dns_name_t *name, isc_boolean_t ispositive)
dns_dbversion_t *version, dns_name_t *name,
isc_boolean_t ispositive)
{
isc_buffer_t *dbuf, b;
dns_name_t *fname;
......@@ -2739,7 +2742,7 @@ query_addwildcardproof(ns_client_t *client, dns_db_t *db,
if (fname == NULL || rdataset == NULL || sigrdataset == NULL)
goto cleanup;
result = dns_db_find(db, name, NULL, dns_rdatatype_nsec, options,
result = dns_db_find(db, name, version, dns_rdatatype_nsec, options,
0, &node, fname, rdataset, sigrdataset);
if (node != NULL)
dns_db_detachnode(db, &node);
......@@ -2791,8 +2794,9 @@ query_addwildcardproof(ns_client_t *client, dns_db_t *db,
}
static void
query_addnxrrsetnsec(ns_client_t *client, dns_db_t *db, dns_name_t **namep,
dns_rdataset_t **rdatasetp, dns_rdataset_t **sigrdatasetp)
query_addnxrrsetnsec(ns_client_t *client, dns_db_t *db,
dns_dbversion_t *version, dns_name_t **namep,
dns_rdataset_t **rdatasetp, dns_rdataset_t **sigrdatasetp)
{
dns_name_t *name;
dns_rdataset_t *sigrdataset;
......@@ -2829,8 +2833,7 @@ query_addnxrrsetnsec(ns_client_t *client, dns_db_t *db, dns_name_t **namep,
return;
/* XXX */
query_addwildcardproof(client, db,
client->query.qname,
query_addwildcardproof(client, db, version, client->query.qname,
ISC_TRUE);
/*
......@@ -3706,7 +3709,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
dbuf, DNS_SECTION_AUTHORITY);
client->query.gluedb = NULL;
if (WANTDNSSEC(client) && dns_db_issecure(db))
query_addds(client, db, node);
query_addds(client, db, node, version);
} else {
/*
* We might have a better answer or delegation
......@@ -3810,7 +3813,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
client->query.attributes &=
~NS_QUERYATTR_CACHEGLUEOK;
if (WANTDNSSEC(client))
query_addds(client, db, node);
query_addds(client, db, node, version);
}
}
goto cleanup;
......@@ -3847,8 +3850,9 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
*/
if (WANTDNSSEC(client)) {
if (dns_rdataset_isassociated(rdataset))
query_addnxrrsetnsec(client, db, &fname,
&rdataset, &sigrdataset);
query_addnxrrsetnsec(client, db, version,
&fname, &rdataset,
&sigrdataset);
}
goto cleanup;
case DNS_R_EMPTYWILD:
......@@ -3897,7 +3901,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
query_addrrset(client, &fname, &rdataset,
&sigrdataset,
NULL, DNS_SECTION_AUTHORITY);
query_addwildcardproof(client, db,
query_addwildcardproof(client, db, version,
client->query.qname,
ISC_FALSE);
}
......@@ -4306,7 +4310,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
* DNSSEC wildcard proofs.
*/
if (need_wildcardproof && dns_db_issecure(db))
query_addwildcardproof(client, db,
query_addwildcardproof(client, db, version,
dns_fixedname_name(&wildcardname),
ISC_TRUE);
cleanup:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment