From 8d298aca1c3b5b8b1c896570f514b2c5b3f96a80 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Mon, 25 Oct 1999 21:19:02 +0000 Subject: [PATCH] suppress glue in most cache retrievals; get rid of NXGLUE --- lib/dns/include/dns/db.h | 13 +++---------- lib/dns/rbtdb.c | 19 ++++--------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h index f1d5cdbe0a..421870dd3f 100644 --- a/lib/dns/include/dns/db.h +++ b/lib/dns/include/dns/db.h @@ -591,7 +591,9 @@ dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, * If type == dns_rdataset_any, then rdataset will not be bound. * * If 'options' does not have DNS_DBFIND_GLUEOK set, then no glue will - * be returned. This option is only meaningful for zone databases. + * be returned. For zone databases, glue is as defined in RFC 2181. + * For cache databases, glue is any rdataset with a trust of + * dns_trust_glue. * * If the DNS_DBFIND_NOWILD option is set, then wildcard matching will * be disabled. This option is only meaningful for zone databases. @@ -687,15 +689,6 @@ dns_db_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, * DNS_R_NXRRSET The desired name exists, but * the desired type does not. * - * DNS_R_NXGLUE The desired name exists, but - * is at or beneath a zonecut. - * The desired type does not - * exist. This result can only - * occur if 'db' is a zone - * database and the - * DNS_DBFIND_GLUEOK option is - * set. - * * DNS_R_NOTFOUND The desired name does not * exist, and no delegation could * be found. This result can only diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index db24461859..0321ab2d46 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -1849,20 +1849,7 @@ zone_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, /* * We were trying to find glue at a node beneath a * zone cut, but didn't. - */ - if ((search.options & DNS_DBFIND_GLUEOK) != 0) { - /* - * Finding glue is OK. Tell the caller the - * glue doesn't exist. - */ - result = DNS_R_NXGLUE; - if (nodep != NULL) { - new_reference(search.rbtdb, node); - *nodep = node; - } - goto node_exit; - } - /* + * * Return the delegation. */ UNLOCK(&(search.rbtdb->node_locks[node->locknum].lock)); @@ -2418,7 +2405,9 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, /* * If we didn't find what we were looking for... */ - if (found == NULL) { + if (found == NULL || + (found->trust == dns_trust_glue && + ((options & DNS_DBFIND_GLUEOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the * deepest zone cut.