From b65c1b247fc45ae896c0a752f7dfb34d9cdfd160 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Tue, 23 Nov 1999 20:53:17 +0000 Subject: [PATCH] add DNS_DBFIND_PENDINGOK support --- lib/dns/include/dns/db.h | 13 ++++++++++++- lib/dns/rbtdb.c | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h index 421870dd3f..19b7a4f391 100644 --- a/lib/dns/include/dns/db.h +++ b/lib/dns/include/dns/db.h @@ -174,6 +174,8 @@ struct dns_db { #define DNS_DBFIND_GLUEOK 0x01 #define DNS_DBFIND_VALIDATEGLUE 0x02 #define DNS_DBFIND_NOWILD 0x04 +#define DNS_DBFIND_PENDINGOK 0x08 + /* * Options that can be specified for dns_db_findzonecut(). */ @@ -595,6 +597,10 @@ dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, * For cache databases, glue is any rdataset with a trust of * dns_trust_glue. * + * If 'options' does not have DNS_DBFIND_PENDINGOK set, then no + * pending data will be returned. This option is only meaningful for + * cache databases. + * * If the DNS_DBFIND_NOWILD option is set, then wildcard matching will * be disabled. This option is only meaningful for zone databases. * @@ -869,6 +875,10 @@ dns_db_createiterator(dns_db_t *db, isc_boolean_t relative_names, *** Rdataset Methods ***/ +/* + * XXXRTH Should we check for glue and pending data in dns_db_findrdataset()? + */ + dns_result_t dns_db_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, dns_rdatatype_t type, dns_rdatatype_t covers, @@ -884,7 +894,8 @@ dns_db_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, * * Care must be used when using this routine to build a DNS response: * 'node' should have been found with dns_db_find(), not - * dns_db_findnode(). No glue checking is done. + * dns_db_findnode(). No glue checking is done. No checking for + * pending data is done. * * The 'now' field is ignored if 'db' is a zone database. If 'db' is a * cache database, an rdataset will not be found unless it expires after diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index ffda31657e..ff2770665e 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -2408,7 +2408,9 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, */ if (found == NULL || (found->trust == dns_trust_glue && - ((options & DNS_DBFIND_GLUEOK) == 0))) { + ((options & DNS_DBFIND_GLUEOK) == 0)) || + (found->trust == dns_trust_pending && + ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the * deepest zone cut.