summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/dns/lookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bind/lib/dns/lookup.c')
-rw-r--r--usr.sbin/bind/lib/dns/lookup.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/usr.sbin/bind/lib/dns/lookup.c b/usr.sbin/bind/lib/dns/lookup.c
index 2c6d0d0aa65..f387111ad68 100644
--- a/usr.sbin/bind/lib/dns/lookup.c
+++ b/usr.sbin/bind/lib/dns/lookup.c
@@ -1,21 +1,21 @@
/*
- * Copyright (C) 2000, 2001 Internet Software Consortium.
+ * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: lookup.c,v 1.9 2001/02/05 19:47:03 bwelling Exp $ */
+/* $ISC: lookup.c,v 1.9.12.5 2004/04/15 02:10:40 marka Exp $ */
#include <config.h>
@@ -168,7 +168,7 @@ view_find(dns_lookup_t *lookup, dns_name_t *foundname) {
dns_name_t *name = dns_fixedname_name(&lookup->name);
dns_rdatatype_t type;
- if (lookup->type == dns_rdatatype_sig)
+ if (lookup->type == dns_rdatatype_rrsig)
type = dns_rdatatype_any;
else
type = lookup->type;
@@ -188,7 +188,7 @@ lookup_find(dns_lookup_t *lookup, dns_fetchevent_t *event) {
dns_name_t *name, *fname, *prefix;
dns_fixedname_t foundname, fixed;
dns_rdata_t rdata = DNS_RDATA_INIT;
- unsigned int nlabels, nbits;
+ unsigned int nlabels;
int order;
dns_namereln_t namereln;
dns_rdata_cname_t cname;
@@ -276,7 +276,7 @@ lookup_find(dns_lookup_t *lookup, dns_fetchevent_t *event) {
break;
case DNS_R_DNAME:
namereln = dns_name_fullcompare(name, fname, &order,
- &nlabels, &nbits);
+ &nlabels);
INSIST(namereln == dns_namereln_subdomain);
/*
* Get the target name of the DNAME.
@@ -294,12 +294,7 @@ lookup_find(dns_lookup_t *lookup, dns_fetchevent_t *event) {
*/
dns_fixedname_init(&fixed);
prefix = dns_fixedname_name(&fixed);
- result = dns_name_split(name, nlabels, nbits, prefix,
- NULL);
- if (result != ISC_R_SUCCESS) {
- dns_rdata_freestruct(&dname);
- break;
- }
+ dns_name_split(name, nlabels, prefix, NULL);
result = dns_name_concatenate(prefix, &dname.dname,
name, NULL);
dns_rdata_freestruct(&dname);
@@ -321,7 +316,7 @@ lookup_find(dns_lookup_t *lookup, dns_fetchevent_t *event) {
dns_db_detachnode(event->db, &event->node);
if (event->db != NULL)
dns_db_detach(&event->db);
- isc_event_free((isc_event_t **)&event);
+ isc_event_free(ISC_EVENT_PTR(&event));
}
/*
@@ -385,14 +380,14 @@ dns_lookup_create(isc_mem_t *mctx, dns_name_t *name, dns_rdatatype_t type,
dns_lookup_t *lookup;
isc_event_t *ievent;
- lookup = isc_mem_get(mctx, sizeof *lookup);
+ lookup = isc_mem_get(mctx, sizeof(*lookup));
if (lookup == NULL)
return (ISC_R_NOMEMORY);
lookup->mctx = mctx;
lookup->options = options;
ievent = isc_event_allocate(mctx, lookup, DNS_EVENT_LOOKUPDONE,
- action, arg, sizeof *lookup->event);
+ action, arg, sizeof(*lookup->event));
if (ievent == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup_lookup;
@@ -447,7 +442,7 @@ dns_lookup_create(isc_mem_t *mctx, dns_name_t *name, dns_rdatatype_t type,
isc_task_detach(&lookup->task);
cleanup_lookup:
- isc_mem_put(mctx, lookup, sizeof *lookup);
+ isc_mem_put(mctx, lookup, sizeof(*lookup));
return (result);
}
@@ -486,7 +481,7 @@ dns_lookup_destroy(dns_lookup_t **lookupp) {
DESTROYLOCK(&lookup->lock);
lookup->magic = 0;
- isc_mem_put(lookup->mctx, lookup, sizeof *lookup);
+ isc_mem_put(lookup->mctx, lookup, sizeof(*lookup));
*lookupp = NULL;
}