summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2007-01-10 19:08:00 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2007-01-10 19:08:00 +0000
commitd3ebbe858ab7fccef9faa9ddc6b31fa65c763765 (patch)
tree1d8e5e596805d3fc4ad06e07592d30c798138f6f /usr.sbin/bind/lib
parent4ceaae588a26669445a79d94a13455d26920d0c8 (diff)
resolve conflicts and regen configure script
Diffstat (limited to 'usr.sbin/bind/lib')
-rw-r--r--usr.sbin/bind/lib/dns/Makefile.in7
-rw-r--r--usr.sbin/bind/lib/dns/adb.c7
-rw-r--r--usr.sbin/bind/lib/dns/api4
-rw-r--r--usr.sbin/bind/lib/dns/cache.c69
-rw-r--r--usr.sbin/bind/lib/dns/dispatch.c87
-rw-r--r--usr.sbin/bind/lib/dns/dnssec.c7
-rw-r--r--usr.sbin/bind/lib/dns/dst_api.c8
-rw-r--r--usr.sbin/bind/lib/dns/gen-win32.h286
-rw-r--r--usr.sbin/bind/lib/dns/gen.c11
-rw-r--r--usr.sbin/bind/lib/dns/include/dns/name.h27
-rw-r--r--usr.sbin/bind/lib/dns/include/dns/rdataset.h12
-rw-r--r--usr.sbin/bind/lib/dns/include/dns/zone.h30
-rw-r--r--usr.sbin/bind/lib/dns/masterdump.c10
-rw-r--r--usr.sbin/bind/lib/dns/message.c46
-rw-r--r--usr.sbin/bind/lib/dns/name.c14
-rw-r--r--usr.sbin/bind/lib/dns/rbtdb.c202
-rw-r--r--usr.sbin/bind/lib/dns/rdata.c6
-rw-r--r--usr.sbin/bind/lib/dns/rdata/generic/dlv_32769.c6
-rw-r--r--usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.c281
-rw-r--r--usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.h33
-rw-r--r--usr.sbin/bind/lib/dns/rdataset.c16
-rw-r--r--usr.sbin/bind/lib/dns/resolver.c53
-rw-r--r--usr.sbin/bind/lib/dns/tsig.c43
-rw-r--r--usr.sbin/bind/lib/dns/validator.c435
-rw-r--r--usr.sbin/bind/lib/dns/xfrin.c67
-rw-r--r--usr.sbin/bind/lib/dns/zone.c94
-rw-r--r--usr.sbin/bind/lib/isc/api4
-rw-r--r--usr.sbin/bind/lib/isc/commandline.c6
-rw-r--r--usr.sbin/bind/lib/isc/hash.c13
-rw-r--r--usr.sbin/bind/lib/isc/inet_aton.c6
-rw-r--r--usr.sbin/bind/lib/isc/lex.c20
-rw-r--r--usr.sbin/bind/lib/isc/log.c7
-rw-r--r--usr.sbin/bind/lib/isc/print.c11
-rw-r--r--usr.sbin/bind/lib/isc/sockaddr.c14
-rw-r--r--usr.sbin/bind/lib/isc/unix/entropy.c14
-rw-r--r--usr.sbin/bind/lib/isc/unix/fsaccess.c6
-rw-r--r--usr.sbin/bind/lib/isc/unix/ifiter_ioctl.c10
-rw-r--r--usr.sbin/bind/lib/isc/unix/socket.c32
-rw-r--r--usr.sbin/bind/lib/isccc/api2
-rw-r--r--usr.sbin/bind/lib/isccfg/parser.c136
-rw-r--r--usr.sbin/bind/lib/lwres/getaddrinfo.c30
-rw-r--r--usr.sbin/bind/lib/lwres/herror.c6
-rw-r--r--usr.sbin/bind/lib/lwres/lwconfig.c6
-rw-r--r--usr.sbin/bind/lib/lwres/lwinetaton.c6
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres.html16
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_buffer.html130
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_config.html60
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_context.329
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_context.html61
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_gabn.html42
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_gai_strerror.html10
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_getaddrinfo.html29
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_gethostent.html51
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_getipnode.349
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_getipnode.html34
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_getnameinfo.html19
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_getrrsetbyname.html29
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_gnba.html51
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_hstrerror.html12
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_inetntop.html17
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_noop.html42
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_packet.html20
-rw-r--r--usr.sbin/bind/lib/lwres/man/lwres_resutil.html32
63 files changed, 1636 insertions, 1287 deletions
diff --git a/usr.sbin/bind/lib/dns/Makefile.in b/usr.sbin/bind/lib/dns/Makefile.in
index b4b8025bcc9..4c804f67e69 100644
--- a/usr.sbin/bind/lib/dns/Makefile.in
+++ b/usr.sbin/bind/lib/dns/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2003 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $ISC: Makefile.in,v 1.126.2.3.2.17 2004/12/09 04:07:15 marka Exp $
+# $ISC: Makefile.in,v 1.126.2.3.2.19 2006/01/06 00:01:42 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -156,7 +156,8 @@ code.h: gen
./gen -s ${srcdir} > code.h
gen: gen.c
- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
+ ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \
+ ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS}
rbtdb64.@O@: rbtdb.c
diff --git a/usr.sbin/bind/lib/dns/adb.c b/usr.sbin/bind/lib/dns/adb.c
index 9dd4f19bebc..4b61459b784 100644
--- a/usr.sbin/bind/lib/dns/adb.c
+++ b/usr.sbin/bind/lib/dns/adb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: adb.c,v 1.181.2.11.2.24 2005/10/14 05:19:00 marka Exp $ */
+/* $ISC: adb.c,v 1.181.2.11.2.26 2006/01/04 23:50:20 marka Exp $ */
/*
* Implementation notes
@@ -2587,8 +2587,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
}
}
- if (bucket != DNS_ADB_INVALIDBUCKET)
- UNLOCK(&adb->namelocks[bucket]);
+ UNLOCK(&adb->namelocks[bucket]);
return (result);
}
diff --git a/usr.sbin/bind/lib/dns/api b/usr.sbin/bind/lib/dns/api
index 7df81573fd7..1bc2b11a91b 100644
--- a/usr.sbin/bind/lib/dns/api
+++ b/usr.sbin/bind/lib/dns/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 21
-LIBREVISION = 1
+LIBINTERFACE = 22
+LIBREVISION = 7
LIBAGE = 0
diff --git a/usr.sbin/bind/lib/dns/cache.c b/usr.sbin/bind/lib/dns/cache.c
index 8175a0a0144..4f47f53b3a6 100644
--- a/usr.sbin/bind/lib/dns/cache.c
+++ b/usr.sbin/bind/lib/dns/cache.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: cache.c,v 1.45.2.4.8.9 2005/03/17 03:58:30 marka Exp $ */
+/* $ISC: cache.c,v 1.45.2.4.8.15 2006/08/01 01:07:05 marka Exp $ */
#include <config.h>
@@ -68,7 +68,6 @@ typedef enum {
* Convenience macros for comprehensive assertion checking.
*/
#define CLEANER_IDLE(c) ((c)->state == cleaner_s_idle && \
- (c)->iterator == NULL && \
(c)->resched_event != NULL)
#define CLEANER_BUSY(c) ((c)->state == cleaner_s_busy && \
(c)->iterator != NULL && \
@@ -101,6 +100,7 @@ struct cache_cleaner {
clean in one increment */
cleaner_state_t state; /* Idle/Busy. */
isc_boolean_t overmem; /* The cache is in an overmem state. */
+ isc_boolean_t replaceiterator;
};
/*
@@ -387,7 +387,7 @@ dns_cache_attachdb(dns_cache_t *cache, dns_db_t **dbp) {
}
isc_result_t
-dns_cache_setfilename(dns_cache_t *cache, char *filename) {
+dns_cache_setfilename(dns_cache_t *cache, const char *filename) {
char *newname;
REQUIRE(VALID_CACHE(cache));
@@ -501,12 +501,18 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr,
cleaner->cache = cache;
cleaner->iterator = NULL;
cleaner->overmem = ISC_FALSE;
+ cleaner->replaceiterator = ISC_FALSE;
cleaner->task = NULL;
cleaner->cleaning_timer = NULL;
cleaner->resched_event = NULL;
cleaner->overmem_event = NULL;
+ result = dns_db_createiterator(cleaner->cache->db, ISC_FALSE,
+ &cleaner->iterator);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
+
if (taskmgr != NULL && timermgr != NULL) {
result = isc_task_create(taskmgr, 1, &cleaner->task);
if (result != ISC_R_SUCCESS) {
@@ -575,6 +581,8 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr,
isc_timer_detach(&cleaner->cleaning_timer);
if (cleaner->task != NULL)
isc_task_detach(&cleaner->task);
+ if (cleaner->iterator != NULL)
+ dns_dbiterator_destroy(&cleaner->iterator);
DESTROYLOCK(&cleaner->lock);
fail:
return (result);
@@ -582,15 +590,17 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr,
static void
begin_cleaning(cache_cleaner_t *cleaner) {
- isc_result_t result;
+ isc_result_t result = ISC_R_SUCCESS;
REQUIRE(CLEANER_IDLE(cleaner));
/*
- * Create an iterator and position it at the beginning of the cache.
+ * Create an iterator, if it does not already exist, and
+ * position it at the beginning of the cache.
*/
- result = dns_db_createiterator(cleaner->cache->db, ISC_FALSE,
- &cleaner->iterator);
+ if (cleaner->iterator == NULL)
+ result = dns_db_createiterator(cleaner->cache->db, ISC_FALSE,
+ &cleaner->iterator);
if (result != ISC_R_SUCCESS)
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
DNS_LOGMODULE_CACHE, ISC_LOG_WARNING,
@@ -600,20 +610,21 @@ begin_cleaning(cache_cleaner_t *cleaner) {
dns_dbiterator_setcleanmode(cleaner->iterator, ISC_TRUE);
result = dns_dbiterator_first(cleaner->iterator);
}
-
if (result != ISC_R_SUCCESS) {
/*
* If the result is ISC_R_NOMORE, the database is empty,
* so there is nothing to be cleaned.
*/
- if (result != ISC_R_NOMORE)
+ if (result != ISC_R_NOMORE && cleaner->iterator != NULL) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"cache cleaner: "
"dns_dbiterator_first() failed: %s",
dns_result_totext(result));
-
- if (cleaner->iterator != NULL)
dns_dbiterator_destroy(&cleaner->iterator);
+ } else if (cleaner->iterator != NULL) {
+ result = dns_dbiterator_pause(cleaner->iterator);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ }
} else {
/*
* Pause the iterator to free its lock.
@@ -634,10 +645,14 @@ begin_cleaning(cache_cleaner_t *cleaner) {
static void
end_cleaning(cache_cleaner_t *cleaner, isc_event_t *event) {
+ isc_result_t result;
+
REQUIRE(CLEANER_BUSY(cleaner));
REQUIRE(event != NULL);
- dns_dbiterator_destroy(&cleaner->iterator);
+ result = dns_dbiterator_pause(cleaner->iterator);
+ if (result != ISC_R_SUCCESS)
+ dns_dbiterator_destroy(&cleaner->iterator);
dns_cache_setcleaninginterval(cleaner->cache,
cleaner->cleaning_interval);
@@ -735,6 +750,17 @@ incremental_cleaning_action(isc_task_t *task, isc_event_t *event) {
if (cleaner->state == cleaner_s_done) {
cleaner->state = cleaner_s_busy;
end_cleaning(cleaner, event);
+ LOCK(&cleaner->cache->lock);
+ LOCK(&cleaner->lock);
+ if (cleaner->replaceiterator) {
+ dns_dbiterator_destroy(&cleaner->iterator);
+ (void) dns_db_createiterator(cleaner->cache->db,
+ ISC_FALSE,
+ &cleaner->iterator);
+ cleaner->replaceiterator = ISC_FALSE;
+ }
+ UNLOCK(&cleaner->lock);
+ UNLOCK(&cleaner->cache->lock);
return;
}
@@ -774,7 +800,7 @@ incremental_cleaning_action(isc_task_t *task, isc_event_t *event) {
* Either the end was reached (ISC_R_NOMORE) or
* some error was signaled. If the cache is still
* overmem and no error was encountered,
- * keep trying to clean it, otherwise stop cleanng.
+ * keep trying to clean it, otherwise stop cleaning.
*/
if (result != ISC_R_NOMORE)
UNEXPECTED_ERROR(__FILE__, __LINE__,
@@ -982,8 +1008,23 @@ dns_cache_flush(dns_cache_t *cache) {
if (result != ISC_R_SUCCESS)
return (result);
+ LOCK(&cache->lock);
+ LOCK(&cache->cleaner.lock);
+ if (cache->cleaner.state == cleaner_s_idle) {
+ if (cache->cleaner.iterator != NULL)
+ dns_dbiterator_destroy(&cache->cleaner.iterator);
+ (void) dns_db_createiterator(db, ISC_FALSE,
+ &cache->cleaner.iterator);
+ } else {
+ if (cache->cleaner.state == cleaner_s_busy)
+ cache->cleaner.state = cleaner_s_done;
+ cache->cleaner.replaceiterator = ISC_TRUE;
+ }
dns_db_detach(&cache->db);
cache->db = db;
+ UNLOCK(&cache->cleaner.lock);
+ UNLOCK(&cache->lock);
+
return (ISC_R_SUCCESS);
}
diff --git a/usr.sbin/bind/lib/dns/dispatch.c b/usr.sbin/bind/lib/dns/dispatch.c
index 81ea88f5c84..d9c4986fe88 100644
--- a/usr.sbin/bind/lib/dns/dispatch.c
+++ b/usr.sbin/bind/lib/dns/dispatch.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: dispatch.c,v 1.101.2.6.2.10 2004/09/01 04:27:41 marka Exp $ */
+/* $ISC: dispatch.c,v 1.101.2.6.2.13 2006/07/19 00:44:04 marka Exp $ */
#include <config.h>
@@ -618,6 +618,50 @@ udp_recv(isc_task_t *task, isc_event_t *ev_in) {
free_buffer(disp, ev->region.base, ev->region.length);
goto unlock;
}
+
+ /*
+ * Now that we have the original dispatch the query was sent
+ * from check that the address and port the response was
+ * sent to make sense.
+ */
+ if (disp != resp->disp) {
+ isc_sockaddr_t a1;
+ isc_sockaddr_t a2;
+
+ /*
+ * Check that the socket types and ports match.
+ */
+ if (disp->socktype != resp->disp->socktype ||
+ isc_sockaddr_getport(&disp->local) !=
+ isc_sockaddr_getport(&resp->disp->local)) {
+ free_buffer(disp, ev->region.base, ev->region.length);
+ goto unlock;
+ }
+
+ /*
+ * If both dispatches are bound to an address then fail as
+ * the addresses can't be equal (enforced by the IP stack).
+ *
+ * Note under Linux a packet can be sent out via IPv4 socket
+ * and the response be received via a IPv6 socket.
+ *
+ * Requests sent out via IPv6 should always come back in
+ * via IPv6.
+ */
+ if (isc_sockaddr_pf(&resp->disp->local) == PF_INET6 &&
+ isc_sockaddr_pf(&disp->local) != PF_INET6) {
+ free_buffer(disp, ev->region.base, ev->region.length);
+ goto unlock;
+ }
+ isc_sockaddr_anyofpf(&a1, isc_sockaddr_pf(&resp->disp->local));
+ isc_sockaddr_anyofpf(&a2, isc_sockaddr_pf(&disp->local));
+ if (!isc_sockaddr_eqaddr(&a1, &resp->disp->local) &&
+ !isc_sockaddr_eqaddr(&a2, &disp->local)) {
+ free_buffer(disp, ev->region.base, ev->region.length);
+ goto unlock;
+ }
+ }
+
queue_response = resp->item_out;
rev = allocate_event(resp->disp);
if (rev == NULL) {
@@ -1651,6 +1695,11 @@ dns_dispatch_getudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
/*
* mgr should be locked.
*/
+
+#ifndef DNS_DISPATCH_HELD
+#define DNS_DISPATCH_HELD 20U
+#endif
+
static isc_result_t
dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
isc_taskmgr_t *taskmgr,
@@ -1661,7 +1710,9 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
{
isc_result_t result;
dns_dispatch_t *disp;
- isc_socket_t *sock;
+ isc_socket_t *sock = NULL;
+ isc_socket_t *held[DNS_DISPATCH_HELD];
+ unsigned int i = 0, j = 0;
/*
* dispatch_allocate() checks mgr for us.
@@ -1672,17 +1723,30 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
return (result);
/*
- * This assumes that the IP stack will *not* quickly reallocate
- * the same port. If it does continually reallocate the same port
- * then we need a mechanism to hold all the blacklisted sockets
- * until we find a usable socket.
+ * Try to allocate a socket that is not on the blacklist.
+ * Hold up to DNS_DISPATCH_HELD sockets to prevent the OS
+ * from returning the same port to us too quickly.
*/
+ memset(held, 0, sizeof(held));
getsocket:
result = create_socket(sockmgr, localaddr, &sock);
if (result != ISC_R_SUCCESS)
goto deallocate_dispatch;
if (isc_sockaddr_getport(localaddr) == 0 && blacklisted(mgr, sock)) {
- isc_socket_detach(&sock);
+ if (held[i] != NULL)
+ isc_socket_detach(&held[i]);
+ held[i++] = sock;
+ sock = NULL;
+ if (i == DNS_DISPATCH_HELD)
+ i = 0;
+ if (j++ == 0xffffU) {
+ mgr_log(mgr, ISC_LOG_ERROR, "avoid-v%s-udp-ports: "
+ "unable to allocate a non-blacklisted port",
+ isc_sockaddr_pf(localaddr) == AF_INET ?
+ "4" : "6");
+ result = ISC_R_FAILURE;
+ goto deallocate_dispatch;
+ }
goto getsocket;
}
@@ -1719,7 +1783,7 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
*dispp = disp;
- return (ISC_R_SUCCESS);
+ goto cleanheld;
/*
* Error returns.
@@ -1730,7 +1794,10 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
isc_socket_detach(&disp->socket);
deallocate_dispatch:
dispatch_free(&disp);
-
+ cleanheld:
+ for (i = 0; i < DNS_DISPATCH_HELD; i++)
+ if (held[i] != NULL)
+ isc_socket_detach(&held[i]);
return (result);
}
diff --git a/usr.sbin/bind/lib/dns/dnssec.c b/usr.sbin/bind/lib/dns/dnssec.c
index 1330472d8c4..0c774f27294 100644
--- a/usr.sbin/bind/lib/dns/dnssec.c
+++ b/usr.sbin/bind/lib/dns/dnssec.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -16,7 +16,7 @@
*/
/*
- * $ISC: dnssec.c,v 1.69.2.5.2.7 2004/06/11 00:30:54 marka Exp $
+ * $ISC: dnssec.c,v 1.69.2.5.2.9 2006/01/04 23:50:20 marka Exp $
*/
@@ -330,8 +330,7 @@ cleanup_array:
cleanup_context:
dst_context_destroy(&ctx);
cleanup_databuf:
- if (databuf != NULL)
- isc_buffer_free(&databuf);
+ isc_buffer_free(&databuf);
cleanup_signature:
isc_mem_put(mctx, sig.signature, sig.siglen);
diff --git a/usr.sbin/bind/lib/dns/dst_api.c b/usr.sbin/bind/lib/dns/dst_api.c
index 43615971626..805d9ec2fe9 100644
--- a/usr.sbin/bind/lib/dns/dst_api.c
+++ b/usr.sbin/bind/lib/dns/dst_api.c
@@ -1,5 +1,5 @@
/*
- * Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2003 Internet Software Consortium.
* Portions Copyright (C) 1995-2000 by Network Associates, Inc.
*
@@ -18,7 +18,7 @@
/*
* Principal Author: Brian Wellington
- * $ISC: dst_api.c,v 1.1.4.1 2004/12/09 04:07:16 marka Exp $
+ * $ISC: dst_api.c,v 1.1.4.3 2006/01/04 23:50:20 marka Exp $
*/
#include <config.h>
@@ -1027,8 +1027,10 @@ write_public_key(const dst_key_t *key, int type, const char *directory) {
}
ret = dns_name_print(key->key_name, fp);
- if (ret != ISC_R_SUCCESS)
+ if (ret != ISC_R_SUCCESS) {
+ fclose(fp);
return (ret);
+ }
fprintf(fp, " ");
diff --git a/usr.sbin/bind/lib/dns/gen-win32.h b/usr.sbin/bind/lib/dns/gen-win32.h
deleted file mode 100644
index f094e202a67..00000000000
--- a/usr.sbin/bind/lib/dns/gen-win32.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001 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 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.
- */
-
-/*
- * Copyright (c) 1987, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $ISC: gen-win32.h,v 1.14.12.3 2004/03/08 09:04:30 marka Exp $ */
-
-/*
- * Principal Authors: Computer Systems Research Group at UC Berkeley
- * Principal ISC caretaker: DCL
- */
-
-/*
- * This file was adapted from the NetBSD project's source tree, RCS ID:
- * NetBSD: getopt.c,v 1.15 1999/09/20 04:39:37 lukem Exp
- *
- * The primary change has been to rename items to the ISC namespace
- * and format in the ISC coding style.
- *
- * This file is responsible for defining two operations that are not
- * directly portable between Unix-like systems and Windows NT, option
- * parsing and directory scanning. It is here because it was decided
- * that the "gen" build utility was not to depend on libisc.a, so
- * the functions delcared in isc/commandline.h and isc/dir.h could not
- * be used.
- *
- * The commandline stuff is pretty much a straight copy from the initial
- * isc/commandline.c. The dir stuff was shrunk to fit the needs of gen.c.
- */
-
-#ifndef DNS_GEN_WIN32_H
-#define DNS_GEN_WIN32_H 1
-
-#include <stdio.h>
-#include <string.h>
-#include <windows.h>
-
-#include <isc/boolean.h>
-#include <isc/lang.h>
-
-int isc_commandline_index = 1; /* Index into parent argv vector. */
-int isc_commandline_option; /* Character checked for validity. */
-
-char *isc_commandline_argument; /* Argument associated with option. */
-char *isc_commandline_progname; /* For printing error messages. */
-
-isc_boolean_t isc_commandline_errprint = ISC_TRUE; /* Print error messages. */
-isc_boolean_t isc_commandline_reset = ISC_TRUE; /* Reset processing. */
-
-#define BADOPT '?'
-#define BADARG ':'
-#define ENDOPT ""
-
-ISC_LANG_BEGINDECLS
-
-/*
- * getopt --
- * Parse argc/argv argument vector.
- */
-int
-isc_commandline_parse(int argc, char * const *argv, const char *options) {
- static char *place = ENDOPT;
- char *option; /* Index into *options of option. */
-
- /*
- * Update scanning pointer, either because a reset was requested or
- * the previous argv was finished.
- */
- if (isc_commandline_reset || *place == '\0') {
- isc_commandline_reset = ISC_FALSE;
-
- if (isc_commandline_progname == NULL)
- isc_commandline_progname = argv[0];
-
- if (isc_commandline_index >= argc ||
- *(place = argv[isc_commandline_index]) != '-') {
- /*
- * Index out of range or points to non-option.
- */
- place = ENDOPT;
- return (-1);
- }
-
- if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
- /*
- * Found '--' to signal end of options. Advance
- * index to next argv, the first non-option.
- */
- isc_commandline_index++;
- place = ENDOPT;
- return (-1);
- }
- }
-
- isc_commandline_option = *place++;
- option = strchr(options, isc_commandline_option);
-
- /*
- * Ensure valid option has been passed as specified by options string.
- * '-:' is never a valid command line option because it could not
- * distinguish ':' from the argument specifier in the options string.
- */
- if (isc_commandline_option == ':' || option == NULL) {
- if (*place == '\0')
- isc_commandline_index++;
-
- if (isc_commandline_errprint && *options != ':')
- fprintf(stderr, "%s: illegal option -- %c\n",
- isc_commandline_progname,
- isc_commandline_option);
-
- return (BADOPT);
- }
-
- if (*++option != ':') {
- /*
- * Option does not take an argument.
- */
- isc_commandline_argument = NULL;
-
- /*
- * Skip to next argv if at the end of the current argv.
- */
- if (*place == '\0')
- ++isc_commandline_index;
-
- } else {
- /*
- * Option needs an argument.
- */
- if (*place != '\0')
- /*
- * Option is in this argv, -D1 style.
- */
- isc_commandline_argument = place;
-
- else if (argc > ++isc_commandline_index)
- /*
- * Option is next argv, -D 1 style.
- */
- isc_commandline_argument = argv[isc_commandline_index];
-
- else {
- /*
- * Argument needed, but no more argv.
- */
- place = ENDOPT;
-
- /*
- * Silent failure with "missing argument" return
- * when ':' starts options string, per historical spec.
- */
- if (*options == ':')
- return (BADARG);
-
- if (isc_commandline_errprint)
- fprintf(stderr,
- "%s: option requires an argument -- %c\n",
- isc_commandline_progname,
- isc_commandline_option);
-
- return (BADOPT);
- }
-
- place = ENDOPT;
-
- /*
- * Point to argv that follows argument.
- */
- isc_commandline_index++;
- }
-
- return (isc_commandline_option);
-}
-
-typedef struct {
- HANDLE handle;
- WIN32_FIND_DATA find_data;
- isc_boolean_t first_file;
- char *filename;
-} isc_dir_t;
-
-isc_boolean_t
-start_directory(const char *path, isc_dir_t *dir) {
- char pattern[_MAX_PATH], *p;
-
- /*
- * Need space for slash-splat and final NUL.
- */
- if (strlen(path) + 3 > sizeof(pattern))
- return (ISC_FALSE);
-
- strlcpy(pattern, path, sizeof(pattern));
-
- /*
- * Append slash (if needed) and splat.
- */
- p = pattern + strlen(pattern);
- if (p != pattern && p[-1] != '\\' && p[-1] != ':')
- *p++ = '\\';
- *p++ = '*';
- *p++ = '\0';
-
- dir->first_file = ISC_TRUE;
-
- dir->handle = FindFirstFile(pattern, &dir->find_data);
-
- if (dir->handle == INVALID_HANDLE_VALUE) {
- dir->filename = NULL;
- return (ISC_FALSE);
- } else {
- dir->filename = dir->find_data.cFileName;
- return (ISC_TRUE);
- }
-}
-
-isc_boolean_t
-next_file(isc_dir_t *dir) {
- if (dir->first_file)
- dir->first_file = ISC_FALSE;
-
- else if (dir->handle != INVALID_HANDLE_VALUE) {
- if (FindNextFile(dir->handle, &dir->find_data) == TRUE)
- dir->filename = dir->find_data.cFileName;
- else
- dir->filename = NULL;
-
- } else
- dir->filename = NULL;
-
- if (dir->filename != NULL)
- return (ISC_TRUE);
- else
- return (ISC_FALSE);
-}
-
-void
-end_directory(isc_dir_t *dir) {
- if (dir->handle != INVALID_HANDLE_VALUE)
- FindClose(dir->handle);
-}
-
-ISC_LANG_ENDDECLS
-
-#endif /* DNS_GEN_WIN32_H */
diff --git a/usr.sbin/bind/lib/dns/gen.c b/usr.sbin/bind/lib/dns/gen.c
index 1b67b58a086..df1470c3b7d 100644
--- a/usr.sbin/bind/lib/dns/gen.c
+++ b/usr.sbin/bind/lib/dns/gen.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,9 +15,14 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: gen.c,v 1.65.2.5.2.6 2004/03/15 01:02:54 marka Exp $ */
+/* $ISC: gen.c,v 1.65.2.5.2.9 2006/10/02 06:31:26 marka Exp $ */
-#include <config.h>
+#ifdef WIN32
+/*
+ * Silence compiler warnings about using strcpy and friends.
+ */
+#define _CRT_SECURE_NO_DEPRECATE 1
+#endif
#include <sys/types.h>
diff --git a/usr.sbin/bind/lib/dns/include/dns/name.h b/usr.sbin/bind/lib/dns/include/dns/name.h
index 129ddfa5036..332148b287f 100644
--- a/usr.sbin/bind/lib/dns/include/dns/name.h
+++ b/usr.sbin/bind/lib/dns/include/dns/name.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: name.h,v 1.95.2.3.2.12 2004/09/08 00:29:34 marka Exp $ */
+/* $ISC: name.h,v 1.95.2.3.2.14 2006/03/02 00:37:20 marka Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
@@ -343,22 +343,6 @@ dns_name_hashbylabel(dns_name_t *name, isc_boolean_t case_sensitive);
* A hash value
*/
-unsigned int
-dns_fullname_hash(dns_name_t *name, isc_boolean_t case_sensitive);
-/*
- * Provide a hash value for 'name'. Unlike dns_name_hash(), this function
- * always takes into account of the entire name to calculate the hash value.
- *
- * Note: if 'case_sensitive' is ISC_FALSE, then names which differ only in
- * case will have the same hash value.
- *
- * Requires:
- * 'name' is a valid name
- *
- * Returns:
- * A hash value
- */
-
/***
*** Comparisons
***/
@@ -605,7 +589,7 @@ dns_name_getlabelsequence(const dns_name_t *source, unsigned int first,
void
-dns_name_clone(dns_name_t *source, dns_name_t *target);
+dns_name_clone(const dns_name_t *source, dns_name_t *target);
/*
* Make 'target' refer to the same name as 'source'.
*
@@ -719,7 +703,8 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
*/
isc_result_t
-dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target);
+dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
+ isc_buffer_t *target);
/*
* Convert 'name' into wire format, compressing it as specified by the
* compression context 'cctx', and storing the result in 'target'.
@@ -999,7 +984,7 @@ dns_name_split(dns_name_t *name, unsigned int suffixlabels,
*/
isc_result_t
-dns_name_dup(dns_name_t *source, isc_mem_t *mctx, dns_name_t *target);
+dns_name_dup(const dns_name_t *source, isc_mem_t *mctx, dns_name_t *target);
/*
* Make 'target' a dynamically allocated copy of 'source'.
*
diff --git a/usr.sbin/bind/lib/dns/include/dns/rdataset.h b/usr.sbin/bind/lib/dns/include/dns/rdataset.h
index ca06b0e34cb..0434565da2e 100644
--- a/usr.sbin/bind/lib/dns/include/dns/rdataset.h
+++ b/usr.sbin/bind/lib/dns/include/dns/rdataset.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: rdataset.h,v 1.41.2.5.2.8 2005/03/17 03:58:31 marka Exp $ */
+/* $ISC: rdataset.h,v 1.41.2.5.2.10 2006/03/02 00:37:20 marka Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
@@ -365,11 +365,11 @@ dns_rdataset_towire(dns_rdataset_t *rdataset,
isc_result_t
dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
- dns_name_t *owner_name,
+ const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
- void *order_arg,
+ const void *order_arg,
unsigned int options,
unsigned int *countp);
/*
@@ -384,11 +384,11 @@ dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
isc_result_t
dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
- dns_name_t *owner_name,
+ const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
- void *order_arg,
+ const void *order_arg,
unsigned int options,
unsigned int *countp,
void **state);
diff --git a/usr.sbin/bind/lib/dns/include/dns/zone.h b/usr.sbin/bind/lib/dns/include/dns/zone.h
index cdf01e1c827..113828b3273 100644
--- a/usr.sbin/bind/lib/dns/include/dns/zone.h
+++ b/usr.sbin/bind/lib/dns/include/dns/zone.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: zone.h,v 1.106.2.7.4.15 2004/10/26 02:08:43 marka Exp $ */
+/* $ISC: zone.h,v 1.106.2.7.4.18 2006/08/01 03:44:00 marka Exp $ */
#ifndef DNS_ZONE_H
#define DNS_ZONE_H 1
@@ -163,7 +163,7 @@ dns_zone_getview(dns_zone_t *zone);
*/
isc_result_t
-dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin);
+dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin);
/*
* Sets the zones origin to 'origin'.
*
@@ -414,11 +414,13 @@ dns_zone_maintenance(dns_zone_t *zone);
*/
isc_result_t
-dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
+dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
isc_uint32_t count);
isc_result_t
-dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
- dns_name_t **keynames, isc_uint32_t count);
+dns_zone_setmasterswithkeys(dns_zone_t *zone,
+ const isc_sockaddr_t *masters,
+ dns_name_t **keynames,
+ isc_uint32_t count);
/*
* Set the list of master servers for the zone.
*
@@ -440,7 +442,7 @@ dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
*/
isc_result_t
-dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
+dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
isc_uint32_t count);
/*
* Set the list of additional servers to be notified when
@@ -525,9 +527,10 @@ dns_zone_setmaxretrytime(dns_zone_t *zone, isc_uint32_t val);
*/
isc_result_t
-dns_zone_setxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_result_t
-dns_zone_setaltxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setaltxfrsource4(dns_zone_t *zone,
+ const isc_sockaddr_t *xfrsource);
/*
* Set the source address to be used in IPv4 zone transfers.
*
@@ -552,9 +555,10 @@ dns_zone_getaltxfrsource4(dns_zone_t *zone);
*/
isc_result_t
-dns_zone_setxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource);
isc_result_t
-dns_zone_setaltxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
+dns_zone_setaltxfrsource6(dns_zone_t *zone,
+ const isc_sockaddr_t *xfrsource);
/*
* Set the source address to be used in IPv6 zone transfers.
*
@@ -579,7 +583,7 @@ dns_zone_getaltxfrsource6(dns_zone_t *zone);
*/
isc_result_t
-dns_zone_setnotifysrc4(dns_zone_t *zone, isc_sockaddr_t *notifysrc);
+dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
/*
* Set the source address to be used with IPv4 NOTIFY messages.
*
@@ -602,7 +606,7 @@ dns_zone_getnotifysrc4(dns_zone_t *zone);
*/
isc_result_t
-dns_zone_setnotifysrc6(dns_zone_t *zone, isc_sockaddr_t *notifysrc);
+dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc);
/*
* Set the source address to be used with IPv6 NOTIFY messages.
*
diff --git a/usr.sbin/bind/lib/dns/masterdump.c b/usr.sbin/bind/lib/dns/masterdump.c
index 0ff669d4da6..d8786d69eb4 100644
--- a/usr.sbin/bind/lib/dns/masterdump.c
+++ b/usr.sbin/bind/lib/dns/masterdump.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: masterdump.c,v 1.56.2.5.2.12 2004/08/28 06:25:19 marka Exp $ */
+/* $ISC: masterdump.c,v 1.56.2.5.2.15 2006/03/10 00:17:21 marka Exp $ */
#include <config.h>
@@ -1160,7 +1160,8 @@ dumptostreaminc(dns_dumpctx_t *dctx) {
}
if (dctx->nodes != 0 && result == ISC_R_SUCCESS) {
- dns_dbiterator_pause(dctx->dbiter);
+ result = dns_dbiterator_pause(dctx->dbiter);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
result = DNS_R_CONTINUE;
} else if (result == ISC_R_NOMORE)
result = ISC_R_SUCCESS;
@@ -1197,9 +1198,8 @@ dns_master_dumptostreaminc(isc_mem_t *mctx, dns_db_t *db,
dns_dumpctx_attach(dctx, dctxp);
return (DNS_R_CONTINUE);
}
- if (dctx != NULL)
- dns_dumpctx_detach(&dctx);
+ dns_dumpctx_detach(&dctx);
return (result);
}
diff --git a/usr.sbin/bind/lib/dns/message.c b/usr.sbin/bind/lib/dns/message.c
index 5dbaa35c31a..8268f2bb7e7 100644
--- a/usr.sbin/bind/lib/dns/message.c
+++ b/usr.sbin/bind/lib/dns/message.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: message.c,v 1.194.2.10.2.20 2005/06/07 01:42:23 marka Exp $ */
+/* $ISC: message.c,v 1.194.2.10.2.24 2006/02/28 06:32:54 marka Exp $ */
/***
*** Imports
@@ -801,11 +801,37 @@ findname(dns_name_t **foundname, dns_name_t *target,
}
isc_result_t
+dns_message_find(dns_name_t *name, dns_rdataclass_t rdclass,
+ dns_rdatatype_t type, dns_rdatatype_t covers,
+ dns_rdataset_t **rdataset)
+{
+ dns_rdataset_t *curr;
+
+ if (rdataset != NULL) {
+ REQUIRE(*rdataset == NULL);
+ }
+
+ for (curr = ISC_LIST_TAIL(name->list);
+ curr != NULL;
+ curr = ISC_LIST_PREV(curr, link)) {
+ if (curr->rdclass == rdclass &&
+ curr->type == type && curr->covers == covers) {
+ if (rdataset != NULL)
+ *rdataset = curr;
+ return (ISC_R_SUCCESS);
+ }
+ }
+
+ return (ISC_R_NOTFOUND);
+}
+
+isc_result_t
dns_message_findtype(dns_name_t *name, dns_rdatatype_t type,
dns_rdatatype_t covers, dns_rdataset_t **rdataset)
{
dns_rdataset_t *curr;
+ REQUIRE(name != NULL);
if (rdataset != NULL) {
REQUIRE(*rdataset == NULL);
}
@@ -1030,7 +1056,7 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
/*
* Can't ask the same question twice.
*/
- result = dns_message_findtype(name, rdtype, 0, NULL);
+ result = dns_message_find(name, rdclass, rdtype, 0, NULL);
if (result == ISC_R_SUCCESS)
DO_FORMERR;
@@ -1190,6 +1216,7 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
&& rdtype != dns_rdatatype_dnskey /* in a TKEY query */
&& rdtype != dns_rdatatype_sig /* SIG(0) */
&& rdtype != dns_rdatatype_tkey /* Win2000 TKEY */
+ && msg->rdclass != dns_rdataclass_any
&& msg->rdclass != rdclass)
DO_FORMERR;
@@ -1279,12 +1306,9 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
rdata->type = rdtype;
rdata->flags = DNS_RDATA_UPDATE;
result = ISC_R_SUCCESS;
- } else if (rdtype == dns_rdatatype_tsig)
+ } else
result = getrdata(source, msg, dctx, rdclass,
rdtype, rdatalen, rdata);
- else
- result = getrdata(source, msg, dctx, msg->rdclass,
- rdtype, rdatalen, rdata);
if (result != ISC_R_SUCCESS)
goto cleanup;
rdata->rdclass = rdclass;
@@ -1360,8 +1384,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
DO_FORMERR;
rdataset = NULL;
- result = dns_message_findtype(name, rdtype, covers,
- &rdataset);
+ result = dns_message_find(name, rdclass, rdtype,
+ covers, &rdataset);
}
/*
@@ -1799,7 +1823,7 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
if (rdataset != NULL &&
(rdataset->attributes & DNS_RDATASETATTR_REQUIREDGLUE) != 0 &&
(rdataset->attributes & DNS_RDATASETATTR_RENDERED) == 0) {
- void *order_arg = msg->order_arg;
+ const void *order_arg = msg->order_arg;
st = *(msg->buffer);
count = 0;
if (partial)
@@ -3187,7 +3211,7 @@ dns_message_getrawmessage(dns_message_t *msg) {
void
dns_message_setsortorder(dns_message_t *msg, dns_rdatasetorderfunc_t order,
- void *order_arg)
+ const void *order_arg)
{
REQUIRE(DNS_MESSAGE_VALID(msg));
msg->order = order;
diff --git a/usr.sbin/bind/lib/dns/name.c b/usr.sbin/bind/lib/dns/name.c
index 4a176c7e0ce..d5700f657bb 100644
--- a/usr.sbin/bind/lib/dns/name.c
+++ b/usr.sbin/bind/lib/dns/name.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: name.c,v 1.127.2.7.2.14 2005/10/14 01:38:48 marka Exp $ */
+/* $ISC: name.c,v 1.127.2.7.2.16 2006/03/02 00:37:20 marka Exp $ */
#include <config.h>
@@ -856,7 +856,7 @@ dns_name_getlabelsequence(const dns_name_t *source,
}
void
-dns_name_clone(dns_name_t *source, dns_name_t *target) {
+dns_name_clone(const dns_name_t *source, dns_name_t *target) {
/*
* Make 'target' refer to the same name as 'source'.
@@ -1748,7 +1748,9 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
}
isc_result_t
-dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) {
+dns_name_towire(const dns_name_t *name, dns_compress_t *cctx,
+ isc_buffer_t *target)
+{
unsigned int methods;
isc_uint16_t offset;
dns_name_t gp; /* Global compression prefix */
@@ -1962,7 +1964,9 @@ dns_name_split(dns_name_t *name, unsigned int suffixlabels,
}
isc_result_t
-dns_name_dup(dns_name_t *source, isc_mem_t *mctx, dns_name_t *target) {
+dns_name_dup(const dns_name_t *source, isc_mem_t *mctx,
+ dns_name_t *target)
+{
/*
* Make 'target' a dynamically allocated copy of 'source'.
*/
diff --git a/usr.sbin/bind/lib/dns/rbtdb.c b/usr.sbin/bind/lib/dns/rbtdb.c
index 3c08492e17a..7e9d2313439 100644
--- a/usr.sbin/bind/lib/dns/rbtdb.c
+++ b/usr.sbin/bind/lib/dns/rbtdb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: rbtdb.c,v 1.168.2.11.2.22 2005/10/14 01:38:48 marka Exp $ */
+/* $ISC: rbtdb.c,v 1.168.2.11.2.26 2006/03/02 23:18:20 marka Exp $ */
/*
* Principal Author: Bob Halley
@@ -1011,6 +1011,47 @@ cleanup_nondirty(rbtdb_version_t *version, rbtdb_changedlist_t *cleanup_list) {
}
}
+static isc_boolean_t
+iszonesecure(dns_db_t *db, dns_dbnode_t *origin) {
+ dns_rdataset_t keyset;
+ dns_rdataset_t nsecset, signsecset;
+ isc_boolean_t haszonekey = ISC_FALSE;
+ isc_boolean_t hasnsec = ISC_FALSE;
+ isc_result_t result;
+
+ dns_rdataset_init(&keyset);
+ result = dns_db_findrdataset(db, origin, NULL, dns_rdatatype_dnskey, 0,
+ 0, &keyset, NULL);
+ if (result == ISC_R_SUCCESS) {
+ dns_rdata_t keyrdata = DNS_RDATA_INIT;
+ result = dns_rdataset_first(&keyset);
+ while (result == ISC_R_SUCCESS) {
+ dns_rdataset_current(&keyset, &keyrdata);
+ if (dns_zonekey_iszonekey(&keyrdata)) {
+ haszonekey = ISC_TRUE;
+ break;
+ }
+ result = dns_rdataset_next(&keyset);
+ }
+ dns_rdataset_disassociate(&keyset);
+ }
+ if (!haszonekey)
+ return (ISC_FALSE);
+
+ dns_rdataset_init(&nsecset);
+ dns_rdataset_init(&signsecset);
+ result = dns_db_findrdataset(db, origin, NULL, dns_rdatatype_nsec, 0,
+ 0, &nsecset, &signsecset);
+ if (result == ISC_R_SUCCESS) {
+ if (dns_rdataset_isassociated(&signsecset)) {
+ hasnsec = ISC_TRUE;
+ dns_rdataset_disassociate(&signsecset);
+ }
+ dns_rdataset_disassociate(&nsecset);
+ }
+ return (hasnsec);
+}
+
static void
closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) {
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
@@ -1136,6 +1177,12 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, isc_boolean_t commit) {
least_serial = rbtdb->least_serial;
UNLOCK(&rbtdb->lock);
+ /*
+ * Update the zone's secure status.
+ */
+ if (version->writer && commit && !IS_CACHE(rbtdb))
+ rbtdb->secure = iszonesecure(db, rbtdb->origin_node);
+
if (cleanup_version != NULL) {
INSIST(EMPTY(cleanup_version->changed_list));
isc_mem_put(rbtdb->common.mctx, cleanup_version,
@@ -2184,12 +2231,12 @@ zone_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
/*
* Certain DNSSEC types are not subject to CNAME matching
- * (RFC 2535, section 2.3.5).
+ * (RFC4035, section 2.5 and RFC3007).
*
* We don't check for RRSIG, because we don't store RRSIG records
* directly.
*/
- if (type == dns_rdatatype_dnskey || type == dns_rdatatype_nsec)
+ if (type == dns_rdatatype_key || type == dns_rdatatype_nsec)
cname_ok = ISC_FALSE;
/*
@@ -2247,9 +2294,15 @@ zone_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
search.need_cleanup = ISC_TRUE;
maybe_zonecut = ISC_FALSE;
at_zonecut = ISC_TRUE;
+ /*
+ * It is not clear if KEY should still be
+ * allowed at the parent side of the zone
+ * cut or not. It is needed for RFC3007
+ * validated updates.
+ */
if ((search.options & DNS_DBFIND_GLUEOK) == 0
&& type != dns_rdatatype_nsec
- && type != dns_rdatatype_dnskey) {
+ && type != dns_rdatatype_key) {
/*
* Glue is not OK, but any answer we
* could return would be glue. Return
@@ -2430,8 +2483,14 @@ zone_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
* and the type is NSEC or KEY.
*/
if (search.zonecut == node) {
+ /*
+ * It is not clear if KEY should still be
+ * allowed at the parent side of the zone
+ * cut or not. It is needed for RFC3007
+ * validated updates.
+ */
if (type == dns_rdatatype_nsec ||
- type == dns_rdatatype_dnskey)
+ type == dns_rdatatype_key)
result = ISC_R_SUCCESS;
else if (type == dns_rdatatype_any)
result = DNS_R_ZONECUT;
@@ -2860,7 +2919,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
rdatasetheader_t *header, *header_prev, *header_next;
rdatasetheader_t *found, *nsheader;
rdatasetheader_t *foundsig, *nssig, *cnamesig;
- rbtdb_rdatatype_t sigtype, nsectype;
+ rbtdb_rdatatype_t sigtype, negtype;
UNUSED(version);
@@ -2918,12 +2977,12 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
/*
* Certain DNSSEC types are not subject to CNAME matching
- * (RFC 2535, section 2.3.5).
+ * (RFC4035, section 2.5 and RFC3007).
*
* We don't check for RRSIG, because we don't store RRSIG records
* directly.
*/
- if (type == dns_rdatatype_dnskey || type == dns_rdatatype_nsec)
+ if (type == dns_rdatatype_key || type == dns_rdatatype_nsec)
cname_ok = ISC_FALSE;
/*
@@ -2935,7 +2994,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
found = NULL;
foundsig = NULL;
sigtype = RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, type);
- nsectype = RBTDB_RDATATYPE_VALUE(0, type);
+ negtype = RBTDB_RDATATYPE_VALUE(0, type);
nsheader = NULL;
nssig = NULL;
cnamesig = NULL;
@@ -3007,7 +3066,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
*/
foundsig = header;
} else if (header->type == RBTDB_RDATATYPE_NCACHEANY ||
- header->type == nsectype) {
+ header->type == negtype) {
/*
* We've found a negative cache entry.
*/
@@ -3618,7 +3677,7 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
dns_rbtnode_t *rbtnode = (dns_rbtnode_t *)node;
rdatasetheader_t *header, *header_next, *found, *foundsig;
- rbtdb_rdatatype_t matchtype, sigmatchtype, nsectype;
+ rbtdb_rdatatype_t matchtype, sigmatchtype, negtype;
isc_result_t result;
REQUIRE(VALID_RBTDB(rbtdb));
@@ -3636,7 +3695,7 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
found = NULL;
foundsig = NULL;
matchtype = RBTDB_RDATATYPE_VALUE(type, covers);
- nsectype = RBTDB_RDATATYPE_VALUE(0, type);
+ negtype = RBTDB_RDATATYPE_VALUE(0, type);
if (covers == 0)
sigmatchtype = RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, type);
else
@@ -3659,7 +3718,7 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
if (header->type == matchtype)
found = header;
else if (header->type == RBTDB_RDATATYPE_NCACHEANY ||
- header->type == nsectype)
+ header->type == negtype)
found = header;
else if (header->type == sigmatchtype)
foundsig = header;
@@ -3785,16 +3844,13 @@ cname_and_other_data(dns_rbtnode_t *node, rbtdb_serial_t serial) {
* Look for active extant "other data".
*
* "Other data" is any rdataset whose type is not
- * DNSKEY, RRSIG DNSKEY, NSEC, RRSIG NSEC,
- * or RRSIG CNAME.
+ * KEY, RRSIG KEY, NSEC, RRSIG NSEC or RRSIG CNAME.
*/
rdtype = RBTDB_RDATATYPE_BASE(header->type);
if (rdtype == dns_rdatatype_rrsig ||
rdtype == dns_rdatatype_sig)
rdtype = RBTDB_RDATATYPE_EXT(header->type);
if (rdtype != dns_rdatatype_nsec &&
- rdtype != dns_rdatatype_dnskey &&
- rdtype != dns_rdatatype_nxt &&
rdtype != dns_rdatatype_key &&
rdtype != dns_rdatatype_cname) {
/*
@@ -3839,7 +3895,8 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
isc_boolean_t header_nx;
isc_boolean_t newheader_nx;
isc_boolean_t merge;
- dns_rdatatype_t nsectype, rdtype, covers;
+ dns_rdatatype_t rdtype, covers;
+ rbtdb_rdatatype_t negtype;
dns_trust_t trust;
/*
@@ -3877,7 +3934,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
newheader_nx = NONEXISTENT(newheader) ? ISC_TRUE : ISC_FALSE;
topheader_prev = NULL;
- nsectype = 0;
+ negtype = 0;
if (rbtversion == NULL && !newheader_nx) {
rdtype = RBTDB_RDATATYPE_BASE(newheader->type);
if (rdtype == 0) {
@@ -3887,12 +3944,13 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
covers = RBTDB_RDATATYPE_EXT(newheader->type);
if (covers == dns_rdatatype_any) {
/*
- * We're adding an NXDOMAIN negative cache
- * entry.
+ * We're adding an negative cache entry
+ * which covers all types (NXDOMAIN,
+ * NODATA(QTYPE=ANY)).
*
* We make all other data stale so that the
* only rdataset that can be found at this
- * node is the NXDOMAIN negative cache entry.
+ * node is the negative cache entry.
*/
for (topheader = rbtnode->data;
topheader != NULL;
@@ -3904,17 +3962,19 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
rbtnode->dirty = 1;
goto find_header;
}
- nsectype = RBTDB_RDATATYPE_VALUE(covers, 0);
+ negtype = RBTDB_RDATATYPE_VALUE(covers, 0);
} else {
/*
* We're adding something that isn't a
* negative cache entry. Look for an extant
- * non-stale NXDOMAIN negative cache entry.
+ * non-stale NXDOMAIN/NODATA(QTYPE=ANY) negative
+ * cache entry.
*/
for (topheader = rbtnode->data;
topheader != NULL;
topheader = topheader->next) {
- if (NXDOMAIN(topheader))
+ if (topheader->type ==
+ RBTDB_RDATATYPE_NCACHEANY)
break;
}
if (topheader != NULL && EXISTS(topheader) &&
@@ -3924,7 +3984,8 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
*/
if (trust < topheader->trust) {
/*
- * The NXDOMAIN is more trusted.
+ * The NXDOMAIN/NODATA(QTYPE=ANY)
+ * is more trusted.
*/
free_rdataset(rbtdb->common.mctx,
newheader);
@@ -3936,7 +3997,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
}
/*
* The new rdataset is better. Expire the
- * NXDOMAIN.
+ * NXDOMAIN/NODATA(QTYPE=ANY).
*/
topheader->ttl = 0;
topheader->attributes |= RDATASET_ATTR_STALE;
@@ -3944,7 +4005,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
topheader = NULL;
goto find_header;
}
- nsectype = RBTDB_RDATATYPE_VALUE(0, rdtype);
+ negtype = RBTDB_RDATATYPE_VALUE(0, rdtype);
}
}
@@ -3952,7 +4013,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
topheader != NULL;
topheader = topheader->next) {
if (topheader->type == newheader->type ||
- topheader->type == nsectype)
+ topheader->type == negtype)
break;
topheader_prev = topheader;
}
@@ -4118,6 +4179,10 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion,
rbtnode->dirty = 1;
if (changed != NULL)
changed->dirty = ISC_TRUE;
+ if (rbtversion == NULL) {
+ header->ttl = 0;
+ header->attributes |= RDATASET_ATTR_STALE;
+ }
}
} else {
/*
@@ -4318,6 +4383,13 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
if (delegating)
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
+ /*
+ * Update the zone's secure status. If version is non-NULL
+ * this is defered until closeversion() is called.
+ */
+ if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb))
+ rbtdb->secure = iszonesecure(db, rbtdb->origin_node);
+
return (result);
}
@@ -4460,6 +4532,13 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
unlock:
UNLOCK(&rbtdb->node_locks[rbtnode->locknum].lock);
+ /*
+ * Update the zone's secure status. If version is non-NULL
+ * this is defered until closeversion() is called.
+ */
+ if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb))
+ rbtdb->secure = iszonesecure(db, rbtdb->origin_node);
+
return (result);
}
@@ -4501,6 +4580,13 @@ deleterdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
UNLOCK(&rbtdb->node_locks[rbtnode->locknum].lock);
+ /*
+ * Update the zone's secure status. If version is non-NULL
+ * this is defered until closeversion() is called.
+ */
+ if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb))
+ rbtdb->secure = iszonesecure(db, rbtdb->origin_node);
+
return (result);
}
@@ -4615,48 +4701,6 @@ beginload(dns_db_t *db, dns_addrdatasetfunc_t *addp, dns_dbload_t **dbloadp) {
return (ISC_R_SUCCESS);
}
-static isc_boolean_t
-iszonesecure(dns_db_t *db, dns_dbnode_t *origin) {
- dns_rdataset_t keyset;
- dns_rdataset_t nsecset, signsecset;
- isc_boolean_t haszonekey = ISC_FALSE;
- isc_boolean_t hasnsec = ISC_FALSE;
- isc_result_t result;
-
- dns_rdataset_init(&keyset);
- result = dns_db_findrdataset(db, origin, NULL, dns_rdatatype_dnskey, 0,
- 0, &keyset, NULL);
- if (result == ISC_R_SUCCESS) {
- dns_rdata_t keyrdata = DNS_RDATA_INIT;
- result = dns_rdataset_first(&keyset);
- while (result == ISC_R_SUCCESS) {
- dns_rdataset_current(&keyset, &keyrdata);
- if (dns_zonekey_iszonekey(&keyrdata)) {
- haszonekey = ISC_TRUE;
- break;
- }
- result = dns_rdataset_next(&keyset);
- }
- dns_rdataset_disassociate(&keyset);
- }
- if (!haszonekey)
- return (ISC_FALSE);
-
- dns_rdataset_init(&nsecset);
- dns_rdataset_init(&signsecset);
- result = dns_db_findrdataset(db, origin, NULL, dns_rdatatype_nsec, 0,
- 0, &nsecset, &signsecset);
- if (result == ISC_R_SUCCESS) {
- if (dns_rdataset_isassociated(&signsecset)) {
- hasnsec = ISC_TRUE;
- dns_rdataset_disassociate(&signsecset);
- }
- dns_rdataset_disassociate(&nsecset);
- }
- return (hasnsec);
-
-}
-
static isc_result_t
endload(dns_db_t *db, dns_dbload_t **dbloadp) {
rbtdb_load_t *loadctx;
@@ -5235,7 +5279,8 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator) {
rdatasetheader_t *header, *top_next;
rbtdb_serial_t serial;
isc_stdtime_t now;
- rbtdb_rdatatype_t type;
+ rbtdb_rdatatype_t type, negtype;
+ dns_rdatatype_t rdtype, covers;
header = rbtiterator->current;
if (header == NULL)
@@ -5252,9 +5297,18 @@ rdatasetiter_next(dns_rdatasetiter_t *iterator) {
LOCK(&rbtdb->node_locks[rbtnode->locknum].lock);
type = header->type;
+ rdtype = RBTDB_RDATATYPE_BASE(header->type);
+ if (rdtype == 0) {
+ covers = RBTDB_RDATATYPE_EXT(header->type);
+ negtype = RBTDB_RDATATYPE_VALUE(covers, 0);
+ } else
+ negtype = RBTDB_RDATATYPE_VALUE(0, rdtype);
for (header = header->next; header != NULL; header = top_next) {
top_next = header->next;
- if (header->type != type) {
+ /*
+ * If not walking back up the down list.
+ */
+ if (header->type != type && header->type != negtype) {
do {
if (header->serial <= serial &&
!IGNORE(header)) {
diff --git a/usr.sbin/bind/lib/dns/rdata.c b/usr.sbin/bind/lib/dns/rdata.c
index 9626b3231f5..6715c4f2251 100644
--- a/usr.sbin/bind/lib/dns/rdata.c
+++ b/usr.sbin/bind/lib/dns/rdata.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: rdata.c,v 1.147.2.11.2.20 2005/07/22 05:27:52 marka Exp $ */
+/* $ISC: rdata.c,v 1.147.2.11.2.22 2006/07/21 02:05:56 marka Exp $ */
#include <config.h>
#include <ctype.h>
@@ -1265,7 +1265,7 @@ hexvalue(char value) {
return (-1);
if (isupper(c))
c = tolower(c);
- if ((s = strchr(hexdigits, value)) == NULL)
+ if ((s = strchr(hexdigits, c)) == NULL)
return (-1);
return (s - hexdigits);
}
diff --git a/usr.sbin/bind/lib/dns/rdata/generic/dlv_32769.c b/usr.sbin/bind/lib/dns/rdata/generic/dlv_32769.c
index bdcb87d4771..f6540a6d41f 100644
--- a/usr.sbin/bind/lib/dns/rdata/generic/dlv_32769.c
+++ b/usr.sbin/bind/lib/dns/rdata/generic/dlv_32769.c
@@ -87,7 +87,7 @@ totext_dlv(ARGS_TOTEXT) {
*/
n = uint16_fromregion(&sr);
isc_region_consume(&sr, 2);
- sprintf(buf, "%u ", n);
+ snprintf(buf, sizeof(buf), "%u ", n);
RETERR(str_totext(buf, target));
/*
@@ -95,7 +95,7 @@ totext_dlv(ARGS_TOTEXT) {
*/
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
- sprintf(buf, "%u ", n);
+ snprintf(buf, sizeof(buf), "%u ", n);
RETERR(str_totext(buf, target));
/*
@@ -103,7 +103,7 @@ totext_dlv(ARGS_TOTEXT) {
*/
n = uint8_fromregion(&sr);
isc_region_consume(&sr, 1);
- sprintf(buf, "%u", n);
+ snprintf(buf, sizeof(buf), "%u", n);
RETERR(str_totext(buf, target));
/*
diff --git a/usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.c b/usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.c
deleted file mode 100644
index 8880fb6572d..00000000000
--- a/usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- *
- * 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 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: dlv_65323.c,v 1.2.2.4 2004/03/16 12:38:14 marka Exp $ */
-
-/* draft-ietf-dnsext-delegation-signer-05.txt */
-
-#ifndef RDATA_GENERIC_DLV_65323_C
-#define RDATA_GENERIC_DLV_65323_C
-
-#define RRTYPE_DLV_ATTRIBUTES 0
-
-static inline isc_result_t
-fromtext_dlv(ARGS_FROMTEXT) {
- isc_token_t token;
-
- REQUIRE(type == 65323);
-
- UNUSED(type);
- UNUSED(rdclass);
- UNUSED(origin);
- UNUSED(options);
- UNUSED(callbacks);
-
- /*
- * Key tag.
- */
- RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
- ISC_FALSE));
- if (token.value.as_ulong > 0xffffU)
- RETTOK(ISC_R_RANGE);
- RETERR(uint16_tobuffer(token.value.as_ulong, target));
-
- /*
- * Algorithm.
- */
- RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
- ISC_FALSE));
- if (token.value.as_ulong > 0xffU)
- RETTOK(ISC_R_RANGE);
- RETERR(uint8_tobuffer(token.value.as_ulong, target));
-
- /*
- * Digest type.
- */
- RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
- ISC_FALSE));
- if (token.value.as_ulong > 0xffU)
- RETTOK(ISC_R_RANGE);
- RETERR(uint8_tobuffer(token.value.as_ulong, target));
- type = (isc_uint16_t) token.value.as_ulong;
-
- /*
- * Digest.
- */
- return (isc_hex_tobuffer(lexer, target, -1));
-}
-
-static inline isc_result_t
-totext_dlv(ARGS_TOTEXT) {
- isc_region_t sr;
- char buf[sizeof("64000 ")];
- unsigned int n;
-
- REQUIRE(rdata->type == 65323);
- REQUIRE(rdata->length != 0);
-
- UNUSED(tctx);
-
- dns_rdata_toregion(rdata, &sr);
-
- /*
- * Key tag.
- */
- n = uint16_fromregion(&sr);
- isc_region_consume(&sr, 2);
- snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
-
- /*
- * Algorithm.
- */
- n = uint8_fromregion(&sr);
- isc_region_consume(&sr, 1);
- snprintf(buf, sizeof(buf), "%u ", n);
- RETERR(str_totext(buf, target));
-
- /*
- * Digest type.
- */
- n = uint8_fromregion(&sr);
- isc_region_consume(&sr, 1);
- snprintf(buf, sizeof(buf), "%u", n);
- RETERR(str_totext(buf, target));
-
- /*
- * Digest.
- */
- if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" (", target));
- RETERR(str_totext(tctx->linebreak, target));
- RETERR(isc_hex_totext(&sr, tctx->width - 2, tctx->linebreak, target));
- if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
- RETERR(str_totext(" )", target));
- return (ISC_R_SUCCESS);
-}
-
-static inline isc_result_t
-fromwire_dlv(ARGS_FROMWIRE) {
- isc_region_t sr;
-
- REQUIRE(type == 65323);
-
- UNUSED(type);
- UNUSED(rdclass);
- UNUSED(dctx);
- UNUSED(options);
-
- isc_buffer_activeregion(source, &sr);
- if (sr.length < 4)
- return (ISC_R_UNEXPECTEDEND);
-
- isc_buffer_forward(source, sr.length);
- return (mem_tobuffer(target, sr.base, sr.length));
-}
-
-static inline isc_result_t
-towire_dlv(ARGS_TOWIRE) {
- isc_region_t sr;
-
- REQUIRE(rdata->type == 65323);
- REQUIRE(rdata->length != 0);
-
- UNUSED(cctx);
-
- dns_rdata_toregion(rdata, &sr);
- return (mem_tobuffer(target, sr.base, sr.length));
-}
-
-static inline int
-compare_dlv(ARGS_COMPARE) {
- isc_region_t r1;
- isc_region_t r2;
-
- REQUIRE(rdata1->type == rdata2->type);
- REQUIRE(rdata1->rdclass == rdata2->rdclass);
- REQUIRE(rdata1->type == 65323);
- REQUIRE(rdata1->length != 0);
- REQUIRE(rdata2->length != 0);
-
- dns_rdata_toregion(rdata1, &r1);
- dns_rdata_toregion(rdata2, &r2);
- return (isc_region_compare(&r1, &r2));
-}
-
-static inline isc_result_t
-fromstruct_dlv(ARGS_FROMSTRUCT) {
- dns_rdata_dlv_t *dlv = source;
-
- REQUIRE(type == 65323);
- REQUIRE(source != NULL);
- REQUIRE(dlv->common.rdtype == type);
- REQUIRE(dlv->common.rdclass == rdclass);
-
- UNUSED(type);
- UNUSED(rdclass);
-
- RETERR(uint16_tobuffer(dlv->key_tag, target));
- RETERR(uint8_tobuffer(dlv->algorithm, target));
- RETERR(uint8_tobuffer(dlv->digest_type, target));
-
- return (mem_tobuffer(target, dlv->digest, dlv->length));
-}
-
-static inline isc_result_t
-tostruct_dlv(ARGS_TOSTRUCT) {
- dns_rdata_dlv_t *dlv = target;
- isc_region_t region;
-
- REQUIRE(rdata->type == 65323);
- REQUIRE(target != NULL);
- REQUIRE(rdata->length != 0);
-
- dlv->common.rdclass = rdata->rdclass;
- dlv->common.rdtype = rdata->type;
- ISC_LINK_INIT(&dlv->common, link);
-
- dns_rdata_toregion(rdata, &region);
-
- dlv->key_tag = uint16_fromregion(&region);
- isc_region_consume(&region, 2);
- dlv->algorithm = uint8_fromregion(&region);
- isc_region_consume(&region, 1);
- dlv->digest_type = uint8_fromregion(&region);
- isc_region_consume(&region, 1);
- dlv->length = region.length;
-
- dlv->digest = mem_maybedup(mctx, region.base, region.length);
- if (dlv->digest == NULL)
- return (ISC_R_NOMEMORY);
-
- dlv->mctx = mctx;
- return (ISC_R_SUCCESS);
-}
-
-static inline void
-freestruct_dlv(ARGS_FREESTRUCT) {
- dns_rdata_dlv_t *dlv = source;
-
- REQUIRE(dlv != NULL);
- REQUIRE(dlv->common.rdtype == 65323);
-
- if (dlv->mctx == NULL)
- return;
-
- if (dlv->digest != NULL)
- isc_mem_free(dlv->mctx, dlv->digest);
- dlv->mctx = NULL;
-}
-
-static inline isc_result_t
-additionaldata_dlv(ARGS_ADDLDATA) {
- REQUIRE(rdata->type == 65323);
-
- UNUSED(rdata);
- UNUSED(add);
- UNUSED(arg);
-
- return (ISC_R_SUCCESS);
-}
-
-static inline isc_result_t
-digest_dlv(ARGS_DIGEST) {
- isc_region_t r;
-
- REQUIRE(rdata->type == 65323);
-
- dns_rdata_toregion(rdata, &r);
-
- return ((digest)(arg, &r));
-}
-
-static inline isc_boolean_t
-checkowner_dlv(ARGS_CHECKOWNER) {
-
- REQUIRE(type == 65323);
-
- UNUSED(name);
- UNUSED(type);
- UNUSED(rdclass);
- UNUSED(wildcard);
-
- return (ISC_TRUE);
-}
-
-static inline isc_boolean_t
-checknames_dlv(ARGS_CHECKNAMES) {
-
- REQUIRE(rdata->type == 65323);
-
- UNUSED(rdata);
- UNUSED(owner);
- UNUSED(bad);
-
- return (ISC_TRUE);
-}
-
-#endif /* RDATA_GENERIC_DLV_65323_C */
diff --git a/usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.h b/usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.h
deleted file mode 100644
index 80bd4c67cb2..00000000000
--- a/usr.sbin/bind/lib/dns/rdata/generic/dlv_65323.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- *
- * 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 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: dlv_65323.h,v 1.2.2.3 2004/03/15 01:02:55 marka Exp $ */
-
-/* draft-ietf-dnsext-delegation-signer-05.txt */
-#ifndef GENERIC_DLV_65323_H
-#define GENERIC_DLV_65323_H 1
-
-typedef struct dns_rdata_dlv {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- isc_uint16_t key_tag;
- isc_uint8_t algorithm;
- isc_uint8_t digest_type;
- isc_uint16_t length;
- unsigned char *digest;
-} dns_rdata_dlv_t;
-
-#endif /* GENERIC_DLV_65323_H */
diff --git a/usr.sbin/bind/lib/dns/rdataset.c b/usr.sbin/bind/lib/dns/rdataset.c
index f865adeef81..92268a289f8 100644
--- a/usr.sbin/bind/lib/dns/rdataset.c
+++ b/usr.sbin/bind/lib/dns/rdataset.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: rdataset.c,v 1.58.2.2.2.10 2004/03/08 09:04:31 marka Exp $ */
+/* $ISC: rdataset.c,v 1.58.2.2.2.12 2006/03/02 00:37:20 marka Exp $ */
#include <config.h>
@@ -280,9 +280,9 @@ towire_compare(const void *av, const void *bv) {
}
static isc_result_t
-towiresorted(dns_rdataset_t *rdataset, dns_name_t *owner_name,
+towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
dns_compress_t *cctx, isc_buffer_t *target,
- dns_rdatasetorderfunc_t order, void *order_arg,
+ dns_rdatasetorderfunc_t order, const void *order_arg,
isc_boolean_t partial, unsigned int options,
unsigned int *countp, void **state)
{
@@ -528,11 +528,11 @@ towiresorted(dns_rdataset_t *rdataset, dns_name_t *owner_name,
isc_result_t
dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
- dns_name_t *owner_name,
+ const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
- void *order_arg,
+ const void *order_arg,
unsigned int options,
unsigned int *countp)
{
@@ -543,11 +543,11 @@ dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
isc_result_t
dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
- dns_name_t *owner_name,
+ const dns_name_t *owner_name,
dns_compress_t *cctx,
isc_buffer_t *target,
dns_rdatasetorderfunc_t order,
- void *order_arg,
+ const void *order_arg,
unsigned int options,
unsigned int *countp,
void **state)
diff --git a/usr.sbin/bind/lib/dns/resolver.c b/usr.sbin/bind/lib/dns/resolver.c
index f2dcb72b20a..c1021bac3a7 100644
--- a/usr.sbin/bind/lib/dns/resolver.c
+++ b/usr.sbin/bind/lib/dns/resolver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: resolver.c,v 1.218.2.18.4.56 2005/10/14 01:38:48 marka Exp $ */
+/* $ISC: resolver.c,v 1.218.2.18.4.64 2006/08/31 03:57:11 marka Exp $ */
#include <config.h>
@@ -27,8 +27,10 @@
#include <dns/acl.h>
#include <dns/adb.h>
+#include <dns/cache.h>
#include <dns/db.h>
#include <dns/dispatch.h>
+#include <dns/ds.h>
#include <dns/events.h>
#include <dns/forward.h>
#include <dns/keytable.h>
@@ -47,6 +49,7 @@
#include <dns/rdatatype.h>
#include <dns/resolver.h>
#include <dns/result.h>
+#include <dns/rootns.h>
#include <dns/tsig.h>
#include <dns/validator.h>
@@ -461,8 +464,7 @@ fctx_starttimer(fetchctx_t *fctx) {
* no further idle events are delivered.
*/
return (isc_timer_reset(fctx->timer, isc_timertype_once,
- &fctx->expires, NULL,
- ISC_TRUE));
+ &fctx->expires, NULL, ISC_TRUE));
}
static inline void
@@ -1028,9 +1030,11 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
if (result != ISC_R_SUCCESS)
goto cleanup_query;
+#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
result = isc_socket_bind(query->tcpsocket, &addr);
if (result != ISC_R_SUCCESS)
goto cleanup_socket;
+#endif
/*
* A dispatch will be created once the connect succeeds.
@@ -1288,6 +1292,12 @@ resquery_send(resquery_t *query) {
}
/*
+ * Clear CD if EDNS is not in use.
+ */
+ if ((query->options & DNS_FETCHOPT_NOEDNS0) != 0)
+ fctx->qmessage->flags &= ~DNS_MESSAGEFLAG_CD;
+
+ /*
* Add TSIG record tailored to the current recipient.
*/
result = dns_view_getpeertsig(fctx->res->view, &ipaddr, &tsigkey);
@@ -3156,10 +3166,12 @@ validated(isc_task_t *task, isc_event_t *event) {
* so, destroy the fctx.
*/
if (SHUTTINGDOWN(fctx) && !sentresponse) {
- maybe_destroy(fctx);
+ maybe_destroy(fctx); /* Locks bucket. */
goto cleanup_event;
}
+ LOCK(&fctx->res->buckets[fctx->bucketnum].lock);
+
/*
* If chaining, we need to make sure that the right result code is
* returned, and that the rdatasets are bound.
@@ -3219,10 +3231,11 @@ validated(isc_task_t *task, isc_event_t *event) {
result = vevent->result;
add_bad(fctx, &addrinfo->sockaddr, result);
isc_event_free(&event);
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
if (sentresponse)
- fctx_done(fctx, result);
+ fctx_done(fctx, result); /* Locks bucket. */
else
- fctx_try(fctx);
+ fctx_try(fctx); /* Locks bucket. */
return;
}
@@ -3267,6 +3280,7 @@ validated(isc_task_t *task, isc_event_t *event) {
result = dns_rdataset_addnoqname(vevent->rdataset,
vevent->proofs[DNS_VALIDATOR_NOQNAMEPROOF]);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ INSIST(vevent->sigrdataset != NULL);
vevent->sigrdataset->ttl = vevent->rdataset->ttl;
}
@@ -3299,9 +3313,9 @@ validated(isc_task_t *task, isc_event_t *event) {
* If we only deferred the destroy because we wanted to cache
* the data, destroy now.
*/
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
if (SHUTTINGDOWN(fctx))
- maybe_destroy(fctx);
-
+ maybe_destroy(fctx); /* Locks bucket. */
goto cleanup_event;
}
@@ -3315,6 +3329,7 @@ validated(isc_task_t *task, isc_event_t *event) {
* more rdatasets that still need to
* be validated.
*/
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
goto cleanup_event;
}
@@ -3387,7 +3402,9 @@ validated(isc_task_t *task, isc_event_t *event) {
if (node != NULL)
dns_db_detachnode(fctx->cache, &node);
- fctx_done(fctx, result);
+ UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
+
+ fctx_done(fctx, result); /* Locks bucket. */
cleanup_event:
isc_event_free(&event);
@@ -4921,6 +4938,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
fctx_try(fctx);
} else {
unsigned int n;
+ dns_rdataset_t *nsrdataset = NULL;
/*
* Retrieve state from fctx->nsfetch before we destroy it.
@@ -4928,13 +4946,20 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
dns_fixedname_init(&fixed);
domain = dns_fixedname_name(&fixed);
dns_name_copy(&fctx->nsfetch->private->domain, domain, NULL);
- dns_rdataset_clone(&fctx->nsfetch->private->nameservers,
- &nameservers);
- dns_resolver_destroyfetch(&fctx->nsfetch);
if (dns_name_equal(&fctx->nsname, domain)) {
fctx_done(fctx, DNS_R_SERVFAIL);
+ dns_resolver_destroyfetch(&fctx->nsfetch);
goto cleanup;
}
+ if (dns_rdataset_isassociated(
+ &fctx->nsfetch->private->nameservers)) {
+ dns_rdataset_clone(
+ &fctx->nsfetch->private->nameservers,
+ &nameservers);
+ nsrdataset = &nameservers;
+ } else
+ domain = NULL;
+ dns_resolver_destroyfetch(&fctx->nsfetch);
n = dns_name_countlabels(&fctx->nsname);
dns_name_getlabelsequence(&fctx->nsname, 1, n - 1,
&fctx->nsname);
@@ -4944,7 +4969,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
FCTXTRACE("continuing to look for parent's NS records");
result = dns_resolver_createfetch(fctx->res, &fctx->nsname,
dns_rdatatype_ns, domain,
- &nameservers, NULL, 0, task,
+ nsrdataset, NULL, 0, task,
resume_dslookup, fctx,
&fctx->nsrrset, NULL,
&fctx->nsfetch);
diff --git a/usr.sbin/bind/lib/dns/tsig.c b/usr.sbin/bind/lib/dns/tsig.c
index 1428497e13e..35c5915fafe 100644
--- a/usr.sbin/bind/lib/dns/tsig.c
+++ b/usr.sbin/bind/lib/dns/tsig.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -16,7 +16,7 @@
*/
/*
- * $ISC: tsig.c,v 1.112.2.3.8.6 2005/03/17 03:58:31 marka Exp $
+ * $ISC: tsig.c,v 1.112.2.3.8.10 2006/05/02 04:21:42 marka Exp $
*/
#include <config.h>
@@ -363,7 +363,7 @@ dns_tsig_sign(dns_message_t *msg) {
isc_buffer_t databuf, sigbuf;
isc_buffer_t *dynbuf;
dns_name_t *owner;
- dns_rdata_t *rdata;
+ dns_rdata_t *rdata = NULL;
dns_rdatalist_t *datalist;
dns_rdataset_t *dataset;
isc_region_t r;
@@ -555,13 +555,12 @@ dns_tsig_sign(dns_message_t *msg) {
tsig.signature = NULL;
}
- rdata = NULL;
ret = dns_message_gettemprdata(msg, &rdata);
if (ret != ISC_R_SUCCESS)
goto cleanup_signature;
ret = isc_buffer_allocate(msg->mctx, &dynbuf, 512);
if (ret != ISC_R_SUCCESS)
- goto cleanup_signature;
+ goto cleanup_rdata;
ret = dns_rdata_fromstruct(rdata, dns_rdataclass_any,
dns_rdatatype_tsig, &tsig, dynbuf);
if (ret != ISC_R_SUCCESS)
@@ -577,7 +576,7 @@ dns_tsig_sign(dns_message_t *msg) {
owner = NULL;
ret = dns_message_gettempname(msg, &owner);
if (ret != ISC_R_SUCCESS)
- goto cleanup_dynbuf;
+ goto cleanup_rdata;
dns_name_init(owner, NULL);
ret = dns_name_dup(&key->name, msg->mctx, owner);
if (ret != ISC_R_SUCCESS)
@@ -587,16 +586,16 @@ dns_tsig_sign(dns_message_t *msg) {
ret = dns_message_gettemprdatalist(msg, &datalist);
if (ret != ISC_R_SUCCESS)
goto cleanup_owner;
+ dataset = NULL;
+ ret = dns_message_gettemprdataset(msg, &dataset);
+ if (ret != ISC_R_SUCCESS)
+ goto cleanup_rdatalist;
datalist->rdclass = dns_rdataclass_any;
datalist->type = dns_rdatatype_tsig;
datalist->covers = 0;
datalist->ttl = 0;
ISC_LIST_INIT(datalist->rdata);
ISC_LIST_APPEND(datalist->rdata, rdata, link);
- dataset = NULL;
- ret = dns_message_gettemprdataset(msg, &dataset);
- if (ret != ISC_R_SUCCESS)
- goto cleanup_owner;
dns_rdataset_init(dataset);
RUNTIME_CHECK(dns_rdatalist_tordataset(datalist, dataset)
== ISC_R_SUCCESS);
@@ -605,16 +604,19 @@ dns_tsig_sign(dns_message_t *msg) {
return (ISC_R_SUCCESS);
-cleanup_owner:
- if (owner != NULL)
- dns_message_puttempname(msg, &owner);
-cleanup_dynbuf:
- if (dynbuf != NULL)
- isc_buffer_free(&dynbuf);
-cleanup_signature:
+ cleanup_rdatalist:
+ dns_message_puttemprdatalist(msg, &datalist);
+ cleanup_owner:
+ dns_message_puttempname(msg, &owner);
+ goto cleanup_rdata;
+ cleanup_dynbuf:
+ isc_buffer_free(&dynbuf);
+ cleanup_rdata:
+ dns_message_puttemprdata(msg, &rdata);
+ cleanup_signature:
if (tsig.signature != NULL)
isc_mem_put(mctx, tsig.signature, sigsize);
-cleanup_context:
+ cleanup_context:
if (ctx != NULL)
dst_context_destroy(&ctx);
return (ret);
@@ -646,8 +648,11 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
msg->verify_attempted = 1;
- if (msg->tcp_continuation)
+ if (msg->tcp_continuation) {
+ if (tsigkey == NULL || msg->querytsig == NULL)
+ return (DNS_R_UNEXPECTEDTSIG);
return (tsig_verify_tcp(source, msg));
+ }
/*
* There should be a TSIG record...
diff --git a/usr.sbin/bind/lib/dns/validator.c b/usr.sbin/bind/lib/dns/validator.c
index 17709ffa4f2..d1a8cabfd1f 100644
--- a/usr.sbin/bind/lib/dns/validator.c
+++ b/usr.sbin/bind/lib/dns/validator.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: validator.c,v 1.91.2.5.8.21 2005/11/02 02:07:47 marka Exp $ */
+/* $ISC: validator.c,v 1.91.2.5.8.27 2006/02/26 23:03:52 marka Exp $ */
#include <config.h>
@@ -43,20 +43,65 @@
#include <dns/validator.h>
#include <dns/view.h>
+/*! \file
+ * \brief
+ * Basic processing sequences.
+ *
+ * \li When called with rdataset and sigrdataset:
+ * validator_start -> validate -> proveunsecure -> startfinddlvsep ->
+ * dlv_validator_start -> validator_start -> validate -> proveunsecure
+ *
+ * validator_start -> validate -> nsecvalidate (secure wildcard answer)
+ *
+ * \li When called with rdataset, sigrdataset and with DNS_VALIDATOR_DLV:
+ * validator_start -> startfinddlvsep -> dlv_validator_start ->
+ * validator_start -> validate -> proveunsecure
+ *
+ * \li When called with rdataset:
+ * validator_start -> proveunsecure -> startfinddlvsep ->
+ * dlv_validator_start -> validator_start -> proveunsecure
+ *
+ * \li When called with rdataset and with DNS_VALIDATOR_DLV:
+ * validator_start -> startfinddlvsep -> dlv_validator_start ->
+ * validator_start -> proveunsecure
+ *
+ * \li When called without a rdataset:
+ * validator_start -> nsecvalidate -> proveunsecure -> startfinddlvsep ->
+ * dlv_validator_start -> validator_start -> nsecvalidate -> proveunsecure
+ *
+ * \li When called without a rdataset and with DNS_VALIDATOR_DLV:
+ * validator_start -> startfinddlvsep -> dlv_validator_start ->
+ * validator_start -> nsecvalidate -> proveunsecure
+ *
+ * validator_start: determines what type of validation to do.
+ * validate: attempts to perform a positive validation.
+ * proveunsecure: attempts to prove the answer comes from a unsecure zone.
+ * nsecvalidate: attempts to prove a negative response.
+ * startfinddlvsep: starts the DLV record lookup.
+ * dlv_validator_start: resets state and restarts the lookup using the
+ * DLV RRset found by startfinddlvsep.
+ */
+
#define VALIDATOR_MAGIC ISC_MAGIC('V', 'a', 'l', '?')
#define VALID_VALIDATOR(v) ISC_MAGIC_VALID(v, VALIDATOR_MAGIC)
-#define VALATTR_SHUTDOWN 0x0001
-#define VALATTR_FOUNDNONEXISTENCE 0x0002
-#define VALATTR_TRIEDVERIFY 0x0004
-#define VALATTR_NEGATIVE 0x0008
-#define VALATTR_INSECURITY 0x0010
-#define VALATTR_DLVTRIED 0x0020
+#define VALATTR_SHUTDOWN 0x0001 /*%< Shutting down. */
+#define VALATTR_TRIEDVERIFY 0x0004 /*%< We have found a key and
+ * have attempted a verify. */
+#define VALATTR_INSECURITY 0x0010 /*%< Attempting proveunsecure. */
+#define VALATTR_DLVTRIED 0x0020 /*%< Looked for a DLV record. */
+#define VALATTR_AUTHNONPENDING 0x0040 /*%< Tidy up pending auth. */
+/*!
+ * NSEC proofs to be looked for.
+ */
#define VALATTR_NEEDNOQNAME 0x0100
#define VALATTR_NEEDNOWILDCARD 0x0200
#define VALATTR_NEEDNODATA 0x0400
+/*!
+ * NSEC proofs that have been found.
+ */
#define VALATTR_FOUNDNOQNAME 0x1000
#define VALATTR_FOUNDNOWILDCARD 0x2000
#define VALATTR_FOUNDNODATA 0x4000
@@ -104,19 +149,35 @@ validator_logcreate(dns_validator_t *val,
static isc_result_t
dlv_validatezonekey(dns_validator_t *val);
-static isc_result_t
+static void
dlv_validator_start(dns_validator_t *val);
static isc_result_t
finddlvsep(dns_validator_t *val, isc_boolean_t resume);
+static void
+auth_nonpending(dns_message_t *message);
+
+static isc_result_t
+startfinddlvsep(dns_validator_t *val, dns_name_t *unsecure);
+
+/*%
+ * Mark the RRsets as a answer.
+ *
+ * If VALATTR_AUTHNONPENDING is set then this is a negative answer
+ * in a insecure zone. We need to mark any pending RRsets as
+ * dns_trust_authauthority answers (this is deferred from resolver.c).
+ */
static inline void
markanswer(dns_validator_t *val) {
validator_log(val, ISC_LOG_DEBUG(3), "marking as answer");
- if (val->event->rdataset)
+ if (val->event->rdataset != NULL)
val->event->rdataset->trust = dns_trust_answer;
- if (val->event->sigrdataset)
+ if (val->event->sigrdataset != NULL)
val->event->sigrdataset->trust = dns_trust_answer;
+ if (val->event->message != NULL &&
+ (val->attributes & VALATTR_AUTHNONPENDING) != 0)
+ auth_nonpending(val->event->message);
}
static void
@@ -155,6 +216,9 @@ exit_check(dns_validator_t *val) {
return (ISC_TRUE);
}
+/*%
+ * Mark pending answers in the authority section as dns_trust_authauthority.
+ */
static void
auth_nonpending(dns_message_t *message) {
isc_result_t result;
@@ -177,6 +241,10 @@ auth_nonpending(dns_message_t *message) {
}
}
+/*%
+ * Look in the NSEC record returned from a DS query to see if there is
+ * a NS RRset at this name. If it is found we are at a delegation point.
+ */
static isc_boolean_t
isdelegation(dns_name_t *name, dns_rdataset_t *rdataset,
isc_result_t dbresult)
@@ -210,6 +278,11 @@ isdelegation(dns_name_t *name, dns_rdataset_t *rdataset,
return (found);
}
+/*%
+ * We have been asked to to look for a key.
+ * If found resume the validation process.
+ * If not found fail the validation process.
+ */
static void
fetch_callback_validator(isc_task_t *task, isc_event_t *event) {
dns_fetchevent_t *devent;
@@ -269,6 +342,11 @@ fetch_callback_validator(isc_task_t *task, isc_event_t *event) {
destroy(val);
}
+/*%
+ * We were asked to look for a DS record as part of following a key chain
+ * upwards. If found resume the validation process. If not found fail the
+ * validation process.
+ */
static void
dsfetched(isc_task_t *task, isc_event_t *event) {
dns_fetchevent_t *devent;
@@ -330,8 +408,16 @@ dsfetched(isc_task_t *task, isc_event_t *event) {
destroy(val);
}
-/*
- * XXX there's too much duplicated code here.
+/*%
+ * We were asked to look for the DS record as part of proving that a
+ * name is unsecure.
+ *
+ * If the DS record doesn't exist and the query name corresponds to
+ * a delegation point we are transitioning from a secure zone to a
+ * unsecure zone.
+ *
+ * If the DS record exists it will be secure. We can continue looking
+ * for the break point in the chain of trust.
*/
static void
dsfetched2(isc_task_t *task, isc_event_t *event) {
@@ -359,7 +445,8 @@ dsfetched2(isc_task_t *task, isc_event_t *event) {
INSIST(val->event != NULL);
- validator_log(val, ISC_LOG_DEBUG(3), "in dsfetched2");
+ validator_log(val, ISC_LOG_DEBUG(3), "in dsfetched2: %s",
+ dns_result_totext(eresult));
LOCK(&val->lock);
if (eresult == DNS_R_NXRRSET || eresult == DNS_R_NCACHENXRRSET) {
/*
@@ -371,9 +458,13 @@ dsfetched2(isc_task_t *task, isc_event_t *event) {
validator_log(val, ISC_LOG_WARNING,
"must be secure failure");
validator_done(val, DNS_R_MUSTBESECURE);
- } else {
+ } else if (val->view->dlv == NULL || DLVTRIED(val)) {
markanswer(val);
validator_done(val, ISC_R_SUCCESS);
+ } else {
+ result = startfinddlvsep(val, tname);
+ if (result != DNS_R_WAIT)
+ validator_done(val, result);
}
} else {
result = proveunsecure(val, ISC_TRUE);
@@ -385,7 +476,9 @@ dsfetched2(isc_task_t *task, isc_event_t *event) {
eresult == DNS_R_NCACHENXDOMAIN)
{
/*
- * Either there is a DS or this is not a zone cut. Continue.
+ * There is a DS which may or may not be a zone cut.
+ * In either case we are still in a secure zone resume
+ * validation.
*/
result = proveunsecure(val, ISC_TRUE);
if (result != DNS_R_WAIT)
@@ -403,6 +496,11 @@ dsfetched2(isc_task_t *task, isc_event_t *event) {
destroy(val);
}
+/*%
+ * Callback from when a DNSKEY RRset has been validated.
+ *
+ * Resumes the stalled validation process.
+ */
static void
keyvalidated(isc_task_t *task, isc_event_t *event) {
dns_validatorevent_t *devent;
@@ -448,6 +546,11 @@ keyvalidated(isc_task_t *task, isc_event_t *event) {
destroy(val);
}
+/*%
+ * Callback when the DS record has been validated.
+ *
+ * Resumes validation of the zone key or the unsecure zone proof.
+ */
static void
dsvalidated(isc_task_t *task, isc_event_t *event) {
dns_validatorevent_t *devent;
@@ -491,10 +594,12 @@ dsvalidated(isc_task_t *task, isc_event_t *event) {
destroy(val);
}
-/*
+/*%
* Return ISC_R_SUCCESS if we can determine that the name doesn't exist
* or we can determine whether there is data or not at the name.
* If the name does not exist return the wildcard name.
+ *
+ * Return ISC_R_IGNORE when the NSEC is not the appropriate one.
*/
static isc_result_t
nsecnoexistnodata(dns_validator_t *val, dns_name_t* name, dns_name_t *nsecname,
@@ -627,7 +732,7 @@ nsecnoexistnodata(dns_validator_t *val, dns_name_t* name, dns_name_t *nsecname,
wild, NULL);
if (result != ISC_R_SUCCESS) {
validator_log(val, ISC_LOG_DEBUG(3),
- "failure generating wilcard name");
+ "failure generating wildcard name");
return (result);
}
}
@@ -637,6 +742,13 @@ nsecnoexistnodata(dns_validator_t *val, dns_name_t* name, dns_name_t *nsecname,
return (ISC_R_SUCCESS);
}
+/*%
+ * Callback for when NSEC records have been validated.
+ *
+ * Looks for NOQNAME and NODATA proofs.
+ *
+ * Resumes nsecvalidate.
+ */
static void
authvalidated(isc_task_t *task, isc_event_t *event) {
dns_validatorevent_t *devent;
@@ -715,44 +827,20 @@ authvalidated(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
}
-static void
-negauthvalidated(isc_task_t *task, isc_event_t *event) {
- dns_validatorevent_t *devent;
- dns_validator_t *val;
- isc_boolean_t want_destroy;
- isc_result_t eresult;
-
- UNUSED(task);
- INSIST(event->ev_type == DNS_EVENT_VALIDATORDONE);
-
- devent = (dns_validatorevent_t *)event;
- val = devent->ev_arg;
- eresult = devent->result;
- isc_event_free(&event);
- dns_validator_destroy(&val->subvalidator);
-
- INSIST(val->event != NULL);
-
- validator_log(val, ISC_LOG_DEBUG(3), "in negauthvalidated");
- LOCK(&val->lock);
- if (eresult == ISC_R_SUCCESS) {
- val->attributes |= VALATTR_FOUNDNONEXISTENCE;
- validator_log(val, ISC_LOG_DEBUG(3),
- "nonexistence proof found");
- auth_nonpending(val->event->message);
- validator_done(val, ISC_R_SUCCESS);
- } else {
- validator_log(val, ISC_LOG_DEBUG(3),
- "negauthvalidated: got %s",
- isc_result_totext(eresult));
- validator_done(val, eresult);
- }
- want_destroy = exit_check(val);
- UNLOCK(&val->lock);
- if (want_destroy)
- destroy(val);
-}
-
+/*%
+ * Looks for the requested name and type in the view (zones and cache).
+ *
+ * When looking for a DLV record also checks to make sure the NSEC record
+ * returns covers the query name as part of aggressive negative caching.
+ *
+ * Returns:
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_NOTFOUND
+ * \li DNS_R_NCACHENXDOMAIN
+ * \li DNS_R_NCACHENXRRSET
+ * \li DNS_R_NXRRSET
+ * \li DNS_R_NXDOMAIN
+ */
static inline isc_result_t
view_find(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) {
dns_fixedname_t fixedname;
@@ -855,12 +943,9 @@ view_find(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) {
dns_rdata_freestruct(&nsec);
result = DNS_R_NCACHENXDOMAIN;
} else if (result != ISC_R_SUCCESS &&
- result != DNS_R_GLUE &&
- result != DNS_R_HINT &&
result != DNS_R_NCACHENXDOMAIN &&
result != DNS_R_NCACHENXRRSET &&
result != DNS_R_NXRRSET &&
- result != DNS_R_HINTNXRRSET &&
result != ISC_R_NOTFOUND) {
goto notfound;
}
@@ -874,11 +959,15 @@ view_find(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) {
return (ISC_R_NOTFOUND);
}
+/*%
+ * Checks to make sure we are not going to loop. As we use a SHARED fetch
+ * the validation process will stall if looping was to occur.
+ */
static inline isc_boolean_t
check_deadlock(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) {
dns_validator_t *parent;
- for (parent = val->parent; parent != NULL; parent = parent->parent) {
+ for (parent = val; parent != NULL; parent = parent->parent) {
if (parent->event != NULL &&
parent->event->type == type &&
dns_name_equal(parent->event->name, name))
@@ -892,6 +981,9 @@ check_deadlock(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) {
return (ISC_FALSE);
}
+/*%
+ * Start a fetch for the requested name and type.
+ */
static inline isc_result_t
create_fetch(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
isc_taskaction_t callback, const char *caller)
@@ -914,6 +1006,9 @@ create_fetch(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
&val->fetch));
}
+/*%
+ * Start a subvalidation process.
+ */
static inline isc_result_t
create_validator(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset,
@@ -936,7 +1031,7 @@ create_validator(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
return (result);
}
-/*
+/*%
* Try to find a key that could have signed 'siginfo' among those
* in 'rdataset'. If found, build a dst_key_t for it and point
* val->key at it.
@@ -1004,6 +1099,9 @@ get_dst_key(dns_validator_t *val, dns_rdata_rrsig_t *siginfo,
return (result);
}
+/*%
+ * Get the key that genertated this signature.
+ */
static isc_result_t
get_key(dns_validator_t *val, dns_rdata_rrsig_t *siginfo) {
isc_result_t result;
@@ -1130,7 +1228,7 @@ compute_keytag(dns_rdata_t *rdata, dns_rdata_dnskey_t *key) {
return (dst_region_computeid(&r, key->algorithm));
}
-/*
+/*%
* Is this keyset self-signed?
*/
static isc_boolean_t
@@ -1172,8 +1270,19 @@ isselfsigned(dns_validator_t *val) {
return (ISC_FALSE);
}
+/*%
+ * Attempt to verify the rdataset using the given key and rdata (RRSIG).
+ * The signature was good and from a wildcard record and the QNAME does
+ * not match the wildcard we need to look for a NOQNAME proof.
+ *
+ * Returns:
+ * \li ISC_R_SUCCESS if the verification succeeds.
+ * \li Others if the verification fails.
+ */
static isc_result_t
-verify(dns_validator_t *val, dst_key_t *key, dns_rdata_t *rdata) {
+verify(dns_validator_t *val, dst_key_t *key, dns_rdata_t *rdata,
+ isc_uint16_t keyid)
+{
isc_result_t result;
dns_fixedname_t fixed;
@@ -1183,8 +1292,8 @@ verify(dns_validator_t *val, dst_key_t *key, dns_rdata_t *rdata) {
key, ISC_FALSE, val->view->mctx, rdata,
dns_fixedname_name(&fixed));
validator_log(val, ISC_LOG_DEBUG(3),
- "verify rdataset: %s",
- isc_result_totext(result));
+ "verify rdataset (keyid=%u): %s",
+ keyid, isc_result_totext(result));
if (result == DNS_R_FROMWILDCARD) {
if (!dns_name_equal(val->event->name,
dns_fixedname_name(&fixed)))
@@ -1194,14 +1303,14 @@ verify(dns_validator_t *val, dst_key_t *key, dns_rdata_t *rdata) {
return (result);
}
-/*
+/*%
* Attempts positive response validation of a normal RRset.
*
* Returns:
- * ISC_R_SUCCESS Validation completed successfully
- * DNS_R_WAIT Validation has started but is waiting
+ * \li ISC_R_SUCCESS Validation completed successfully
+ * \li DNS_R_WAIT Validation has started but is waiting
* for an event.
- * Other return codes are possible and all indicate failure.
+ * \li Other return codes are possible and all indicate failure.
*/
static isc_result_t
validate(dns_validator_t *val, isc_boolean_t resume) {
@@ -1272,7 +1381,8 @@ validate(dns_validator_t *val, isc_boolean_t resume) {
}
do {
- result = verify(val, val->key, &rdata);
+ result = verify(val, val->key, &rdata,
+ val->siginfo->keyid);
if (result == ISC_R_SUCCESS)
break;
if (val->keynode != NULL) {
@@ -1356,6 +1466,10 @@ validate(dns_validator_t *val, isc_boolean_t resume) {
return (DNS_R_NOVALIDSIG);
}
+/*%
+ * Validate the DNSKEY RRset by looking for a DNSKEY that matches a
+ * DLV record and that also verifies the DNSKEY RRset.
+ */
static isc_result_t
dlv_validatezonekey(dns_validator_t *val) {
dns_keytag_t keytag;
@@ -1373,12 +1487,12 @@ dlv_validatezonekey(dns_validator_t *val) {
unsigned char dsbuf[DNS_DS_BUFFERSIZE];
validator_log(val, ISC_LOG_DEBUG(3), "dlv_validatezonekey");
+
/*
* Look through the DLV record and find the keys that can sign the
* key set and the matching signature. For each such key, attempt
* verification.
*/
-
supported_algorithm = ISC_FALSE;
for (result = dns_rdataset_first(&val->dlv);
@@ -1456,7 +1570,7 @@ dlv_validatezonekey(dns_validator_t *val) {
*/
continue;
- result = verify(val, dstkey, &sigrdata);
+ result = verify(val, dstkey, &sigrdata, sig.keyid);
dst_key_free(&dstkey);
if (result == ISC_R_SUCCESS)
break;
@@ -1486,14 +1600,14 @@ dlv_validatezonekey(dns_validator_t *val) {
return (DNS_R_NOVALIDSIG);
}
-/*
+/*%
* Attempts positive response validation of an RRset containing zone keys.
*
* Returns:
- * ISC_R_SUCCESS Validation completed successfully
- * DNS_R_WAIT Validation has started but is waiting
+ * \li ISC_R_SUCCESS Validation completed successfully
+ * \li DNS_R_WAIT Validation has started but is waiting
* for an event.
- * Other return codes are possible and all indicate failure.
+ * \li Other return codes are possible and all indicate failure.
*/
static isc_result_t
validatezonekey(dns_validator_t *val) {
@@ -1505,12 +1619,14 @@ validatezonekey(dns_validator_t *val) {
dns_rdata_t keyrdata = DNS_RDATA_INIT;
dns_rdata_t sigrdata = DNS_RDATA_INIT;
unsigned char dsbuf[DNS_DS_BUFFERSIZE];
+ char namebuf[DNS_NAME_FORMATSIZE];
dns_keytag_t keytag;
dns_rdata_ds_t ds;
dns_rdata_dnskey_t key;
dns_rdata_rrsig_t sig;
dst_key_t *dstkey;
isc_boolean_t supported_algorithm;
+ isc_boolean_t atsep = ISC_FALSE;
/*
* Caller must be holding the validator lock.
@@ -1541,9 +1657,13 @@ validatezonekey(dns_validator_t *val) {
sig.algorithm,
sig.keyid,
&keynode);
+ if (result == DNS_R_PARTIALMATCH ||
+ result == ISC_R_SUCCESS)
+ atsep = ISC_TRUE;
while (result == ISC_R_SUCCESS) {
dstkey = dns_keynode_key(keynode);
- result = verify(val, dstkey, &sigrdata);
+ result = verify(val, dstkey, &sigrdata,
+ sig.keyid);
if (result == ISC_R_SUCCESS) {
dns_keytable_detachkeynode(val->keytable,
&keynode);
@@ -1578,6 +1698,22 @@ validatezonekey(dns_validator_t *val) {
return (DNS_R_NOVALIDDS);
}
+ if (atsep) {
+ /*
+ * We have not found a key to verify this DNSKEY
+ * RRset. As this is a SEP we have to assume that
+ * the RRset is invalid.
+ */
+ dns_name_format(val->event->name, namebuf,
+ sizeof(namebuf));
+ validator_log(val, ISC_LOG_DEBUG(2),
+ "unable to find a DNSKEY which verifies "
+ "the DNSKEY RRset and also matches one "
+ "of specified trusted-keys for '%s'",
+ namebuf);
+ return (DNS_R_NOVALIDKEY);
+ }
+
/*
* Otherwise, try to find the DS record.
*/
@@ -1680,6 +1816,9 @@ validatezonekey(dns_validator_t *val) {
dns_rdataset_init(&trdataset);
dns_rdataset_clone(val->event->rdataset, &trdataset);
+ /*
+ * Look for the KEY that matches the DS record.
+ */
for (result = dns_rdataset_first(&trdataset);
result == ISC_R_SUCCESS;
result = dns_rdataset_next(&trdataset))
@@ -1714,7 +1853,7 @@ validatezonekey(dns_validator_t *val) {
dns_rdataset_current(val->event->sigrdataset,
&sigrdata);
(void)dns_rdata_tostruct(&sigrdata, &sig, NULL);
- if (ds.key_tag != sig.keyid &&
+ if (ds.key_tag != sig.keyid ||
ds.algorithm != sig.algorithm)
continue;
@@ -1728,8 +1867,7 @@ validatezonekey(dns_validator_t *val) {
* This really shouldn't happen, but...
*/
continue;
-
- result = verify(val, dstkey, &sigrdata);
+ result = verify(val, dstkey, &sigrdata, sig.keyid);
dst_key_free(&dstkey);
if (result == ISC_R_SUCCESS)
break;
@@ -1759,14 +1897,14 @@ validatezonekey(dns_validator_t *val) {
return (DNS_R_NOVALIDSIG);
}
-/*
+/*%
* Starts a positive response validation.
*
* Returns:
- * ISC_R_SUCCESS Validation completed successfully
- * DNS_R_WAIT Validation has started but is waiting
+ * \li ISC_R_SUCCESS Validation completed successfully
+ * \li DNS_R_WAIT Validation has started but is waiting
* for an event.
- * Other return codes are possible and all indicate failure.
+ * \li Other return codes are possible and all indicate failure.
*/
static isc_result_t
start_positive_validation(dns_validator_t *val) {
@@ -1779,6 +1917,14 @@ start_positive_validation(dns_validator_t *val) {
return (validatezonekey(val));
}
+/*%
+ * Look for NODATA at the wildcard and NOWILDCARD proofs in the
+ * previously validated NSEC records. As these proofs are mutually
+ * exclusive we stop when one is found.
+ *
+ * Returns
+ * \li ISC_R_SUCCESS
+ */
static isc_result_t
checkwildcard(dns_validator_t *val) {
dns_name_t *name, *wild;
@@ -1851,6 +1997,18 @@ checkwildcard(dns_validator_t *val) {
return (result);
}
+/*%
+ * Prove a negative answer is good or that there is a NOQNAME when the
+ * answer is from a wildcard.
+ *
+ * Loop through the authority section looking for NODATA, NOWILDCARD
+ * and NOQNAME proofs in the NSEC records by calling authvalidated().
+ *
+ * If the required proofs are found we are done.
+ *
+ * If the proofs are not found attempt to prove this is a unsecure
+ * response.
+ */
static isc_result_t
nsecvalidate(dns_validator_t *val, isc_boolean_t resume) {
dns_name_t *name;
@@ -1946,7 +2104,8 @@ nsecvalidate(dns_validator_t *val, isc_boolean_t resume) {
return (result);
/*
- * Do we only need to check for NOQNAME?
+ * Do we only need to check for NOQNAME? To get here we must have
+ * had a secure wildcard answer.
*/
if ((val->attributes & VALATTR_NEEDNODATA) == 0 &&
(val->attributes & VALATTR_NEEDNOWILDCARD) == 0 &&
@@ -1982,28 +2141,17 @@ nsecvalidate(dns_validator_t *val, isc_boolean_t resume) {
((val->attributes & VALATTR_NEEDNOQNAME) != 0 &&
(val->attributes & VALATTR_FOUNDNOQNAME) != 0 &&
(val->attributes & VALATTR_NEEDNOWILDCARD) != 0 &&
- (val->attributes & VALATTR_FOUNDNOWILDCARD) != 0))
- val->attributes |= VALATTR_FOUNDNONEXISTENCE;
-
- if ((val->attributes & VALATTR_FOUNDNONEXISTENCE) == 0) {
- if (!val->seensig && val->soaset != NULL) {
- result = create_validator(val, val->soaname,
- dns_rdatatype_soa,
- val->soaset, NULL,
- negauthvalidated,
- "nsecvalidate");
- if (result != ISC_R_SUCCESS)
- return (result);
- return (DNS_R_WAIT);
- }
+ (val->attributes & VALATTR_FOUNDNOWILDCARD) != 0)) {
validator_log(val, ISC_LOG_DEBUG(3),
- "nonexistence proof not found");
- return (DNS_R_NOVALIDNSEC);
- } else {
- validator_log(val, ISC_LOG_DEBUG(3),
- "nonexistence proof found");
+ "nonexistence proof(s) found");
return (ISC_R_SUCCESS);
}
+
+ validator_log(val, ISC_LOG_DEBUG(3),
+ "nonexistence proof(s) not found");
+ val->attributes |= VALATTR_AUTHNONPENDING;
+ val->attributes |= VALATTR_INSECURITY;
+ return (proveunsecure(val, ISC_FALSE));
}
static isc_boolean_t
@@ -2029,6 +2177,11 @@ check_ds(dns_validator_t *val, dns_name_t *name, dns_rdataset_t *rdataset) {
return (ISC_FALSE);
}
+/*%
+ * Callback from fetching a DLV record.
+ *
+ * Resumes the DLV lookup process.
+ */
static void
dlvfetched(isc_task_t *task, isc_event_t *event) {
char namebuf[DNS_NAME_FORMATSIZE];
@@ -2065,9 +2218,7 @@ dlvfetched(isc_task_t *task, isc_event_t *event) {
dns_rdataset_clone(&val->frdataset, &val->dlv);
val->havedlvsep = ISC_TRUE;
validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf);
- result = dlv_validator_start(val);
- if (result != DNS_R_WAIT)
- validator_done(val, result);
+ dlv_validator_start(val);
} else if (eresult == DNS_R_NXRRSET ||
eresult == DNS_R_NXDOMAIN ||
eresult == DNS_R_NCACHENXRRSET ||
@@ -2078,9 +2229,7 @@ dlvfetched(isc_task_t *task, isc_event_t *event) {
namebuf, sizeof(namebuf));
validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found",
namebuf);
- result = dlv_validator_start(val);
- if (result != DNS_R_WAIT)
- validator_done(val, result);
+ dlv_validator_start(val);
} else if (result == ISC_R_NOTFOUND) {
validator_log(val, ISC_LOG_DEBUG(3), "DLV not found");
markanswer(val);
@@ -2094,6 +2243,7 @@ dlvfetched(isc_task_t *task, isc_event_t *event) {
} else {
validator_log(val, ISC_LOG_DEBUG(3), "DLV lookup: %s",
dns_result_totext(eresult));
+ validator_done(val, eresult);
}
want_destroy = exit_check(val);
UNLOCK(&val->lock);
@@ -2101,6 +2251,14 @@ dlvfetched(isc_task_t *task, isc_event_t *event) {
destroy(val);
}
+/*%
+ * Start the DLV lookup proccess.
+ *
+ * Returns
+ * \li ISC_R_SUCCESS
+ * \li DNS_R_WAIT
+ * \li Others on validation failures.
+ */
static isc_result_t
startfinddlvsep(dns_validator_t *val, dns_name_t *unsecure) {
char namebuf[DNS_NAME_FORMATSIZE];
@@ -2135,9 +2293,19 @@ startfinddlvsep(dns_validator_t *val, dns_name_t *unsecure) {
dns_name_format(dns_fixedname_name(&val->dlvsep), namebuf,
sizeof(namebuf));
validator_log(val, ISC_LOG_DEBUG(3), "DLV %s found", namebuf);
- return (dlv_validator_start(val));
+ dlv_validator_start(val);
+ return (DNS_R_WAIT);
}
+/*%
+ * Continue the DLV lookup process.
+ *
+ * Returns
+ * \li ISC_R_SUCCESS
+ * \li ISC_R_NOTFOUND
+ * \li DNS_R_WAIT
+ * \li Others on validation failure.
+ */
static isc_result_t
finddlvsep(dns_validator_t *val, isc_boolean_t resume) {
char namebuf[DNS_NAME_FORMATSIZE];
@@ -2147,7 +2315,7 @@ finddlvsep(dns_validator_t *val, isc_boolean_t resume) {
dns_name_t noroot;
isc_result_t result;
unsigned int labels;
-
+
INSIST(val->view->dlv != NULL);
if (!resume) {
@@ -2231,11 +2399,24 @@ finddlvsep(dns_validator_t *val, isc_boolean_t resume) {
return (ISC_R_NOTFOUND);
}
-/*
+/*%
* proveunsecure walks down from the SEP looking for a break in the
- * chain of trust. That occurs when we can prove the DS record does
+ * chain of trust. That occurs when we can prove the DS record does
* not exist at a delegation point or the DS exists at a delegation
* but we don't support the algorithm/digest.
+ *
+ * If DLV is active and we look for a DLV record at or below the
+ * point we go insecure. If found we restart the validation process.
+ * If not found or DLV isn't active we mark the response as a answer.
+ *
+ * Returns:
+ * \li ISC_R_SUCCESS val->event->name is in a unsecure zone
+ * \li DNS_R_WAIT validation is in progress.
+ * \li DNS_R_MUSTBESECURE val->event->name is supposed to be secure
+ * (policy) but we proved that it is unsecure.
+ * \li DNS_R_NOVALIDSIG
+ * \li DNS_R_NOVALIDNSEC
+ * \li DNS_R_NOTINSECURE
*/
static isc_result_t
proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
@@ -2253,7 +2434,7 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
result = dns_keytable_finddeepestmatch(val->keytable,
val->event->name,
secroot);
-
+
if (result == ISC_R_NOTFOUND) {
validator_log(val, ISC_LOG_DEBUG(3),
"not beneath secure root");
@@ -2395,8 +2576,7 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
goto out;
return (DNS_R_WAIT);
} else if (result == DNS_R_NXDOMAIN ||
- result == DNS_R_NCACHENXDOMAIN)
- {
+ result == DNS_R_NCACHENXDOMAIN) {
/*
* This is not a zone cut. Assuming things are
* as expected, continue.
@@ -2441,7 +2621,10 @@ proveunsecure(dns_validator_t *val, isc_boolean_t resume) {
return (result);
}
-static isc_result_t
+/*%
+ * Reset state and revalidate the answer using DLV.
+ */
+static void
dlv_validator_start(dns_validator_t *val) {
isc_event_t *event;
@@ -2455,9 +2638,20 @@ dlv_validator_start(dns_validator_t *val) {
event = (isc_event_t *)val->event;
isc_task_send(val->task, &event);
- return (DNS_R_WAIT);
}
+/*%
+ * Start the validation process.
+ *
+ * Attempt to valididate the answer based on the category it appears to
+ * fall in.
+ * \li 1. secure positive answer.
+ * \li 2. unsecure positive answer.
+ * \li 3. a negative answer (secure or unsecure).
+ *
+ * Note a answer that appears to be a secure positive answer may actually
+ * be a unsecure positive answer.
+ */
static void
validator_start(isc_task_t *task, isc_event_t *event) {
dns_validator_t *val;
@@ -2529,7 +2723,6 @@ validator_start(isc_task_t *task, isc_event_t *event) {
validator_log(val, ISC_LOG_DEBUG(3),
"attempting negative response validation");
- val->attributes |= VALATTR_NEGATIVE;
if (val->event->message->rcode == dns_rcode_nxdomain) {
val->attributes |= VALATTR_NEEDNOQNAME;
val->attributes |= VALATTR_NEEDNOWILDCARD;
@@ -2640,7 +2833,7 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
cleanup_event:
isc_task_detach(&tclone);
- isc_event_free((isc_event_t **)&val->event);
+ isc_event_free(ISC_EVENT_PTR(&event));
cleanup_val:
dns_view_weakdetach(&val->view);
diff --git a/usr.sbin/bind/lib/dns/xfrin.c b/usr.sbin/bind/lib/dns/xfrin.c
index a0bd284617f..21293ddd92f 100644
--- a/usr.sbin/bind/lib/dns/xfrin.c
+++ b/usr.sbin/bind/lib/dns/xfrin.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: xfrin.c,v 1.124.2.4.2.12 2005/11/03 23:08:41 marka Exp $ */
+/* $ISC: xfrin.c,v 1.124.2.4.2.16 2006/07/19 01:04:24 marka Exp $ */
#include <config.h>
@@ -73,6 +73,8 @@
* when the first two (2) response RRs have already been received.
*/
typedef enum {
+ XFRST_SOAQUERY,
+ XFRST_GOTSOA,
XFRST_INITIALSOA,
XFRST_FIRSTDATA,
XFRST_IXFR_DELSOA,
@@ -424,6 +426,30 @@ xfr_rr(dns_xfrin_ctx_t *xfr, dns_name_t *name, isc_uint32_t ttl,
redo:
switch (xfr->state) {
+ case XFRST_SOAQUERY:
+ if (rdata->type != dns_rdatatype_soa) {
+ xfrin_log(xfr, ISC_LOG_ERROR,
+ "non-SOA response to SOA query");
+ FAIL(DNS_R_FORMERR);
+ }
+ xfr->end_serial = dns_soa_getserial(rdata);
+ if (!DNS_SERIAL_GT(xfr->end_serial, xfr->ixfr.request_serial) &&
+ !dns_zone_isforced(xfr->zone)) {
+ xfrin_log(xfr, ISC_LOG_DEBUG(3),
+ "requested serial %u, "
+ "master has %u, not updating",
+ xfr->ixfr.request_serial, xfr->end_serial);
+ FAIL(DNS_R_UPTODATE);
+ }
+ xfr->state = XFRST_GOTSOA;
+ break;
+
+ case XFRST_GOTSOA:
+ /*
+ * Skip other records in the answer section.
+ */
+ break;
+
case XFRST_INITIALSOA:
if (rdata->type != dns_rdatatype_soa) {
xfrin_log(xfr, ISC_LOG_ERROR,
@@ -589,6 +615,9 @@ dns_xfrin_create2(dns_zone_t *zone, dns_rdatatype_t xfrtype,
(void)dns_zone_getdb(zone, &db);
+ if (xfrtype == dns_rdatatype_soa || xfrtype == dns_rdatatype_ixfr)
+ REQUIRE(db != NULL);
+
CHECK(xfrin_create(mctx, zone, db, task, timermgr, socketmgr, zonename,
dns_zone_getclass(zone), xfrtype, masteraddr,
sourceaddr, tsigkey, &xfr));
@@ -754,7 +783,10 @@ xfrin_create(isc_mem_t *mctx,
dns_diff_init(xfr->mctx, &xfr->diff);
xfr->difflen = 0;
- xfr->state = XFRST_INITIALSOA;
+ if (reqtype == dns_rdatatype_soa)
+ xfr->state = XFRST_SOAQUERY;
+ else
+ xfr->state = XFRST_INITIALSOA;
/* end_serial */
xfr->nmsg = 0;
@@ -797,7 +829,18 @@ xfrin_create(isc_mem_t *mctx,
return (ISC_R_SUCCESS);
failure:
- xfrin_fail(xfr, result, "failed creating transfer context");
+ if (xfr->timer != NULL)
+ isc_timer_detach(&xfr->timer);
+ if (dns_name_dynamic(&xfr->name))
+ dns_name_free(&xfr->name, xfr->mctx);
+ if (xfr->tsigkey != NULL)
+ dns_tsigkey_detach(&xfr->tsigkey);
+ if (xfr->db != NULL)
+ dns_db_detach(&xfr->db);
+ isc_task_detach(&xfr->task);
+ dns_zone_idetach(&xfr->zone);
+ isc_mem_put(mctx, xfr, sizeof(*xfr));
+
return (result);
}
@@ -808,7 +851,9 @@ xfrin_start(dns_xfrin_ctx_t *xfr) {
isc_sockaddr_pf(&xfr->sourceaddr),
isc_sockettype_tcp,
&xfr->socket));
+#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr));
+#endif
CHECK(isc_socket_connect(xfr->socket, &xfr->masteraddr, xfr->task,
xfrin_connect_done, xfr));
xfr->connects++;
@@ -987,7 +1032,9 @@ xfrin_send_request(dns_xfrin_ctx_t *xfr) {
CHECK(tuple2msgname(soatuple, msg, &msgsoaname));
dns_message_addname(msg, msgsoaname, DNS_SECTION_AUTHORITY);
- }
+ } else if (xfr->reqtype == dns_rdatatype_soa)
+ CHECK(dns_db_getsoaserial(xfr->db, NULL,
+ &xfr->ixfr.request_serial));
xfr->checkid = ISC_TRUE;
xfr->id++;
@@ -1148,8 +1195,8 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
try_axfr:
dns_message_destroy(&msg);
xfrin_reset(xfr);
- xfr->reqtype = dns_rdatatype_axfr;
- xfr->state = XFRST_INITIALSOA;
+ xfr->reqtype = dns_rdatatype_soa;
+ xfr->state = XFRST_SOAQUERY;
(void)xfrin_start(xfr);
return;
}
@@ -1246,7 +1293,11 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
dns_message_destroy(&msg);
- if (xfr->state == XFRST_END) {
+ if (xfr->state == XFRST_GOTSOA) {
+ xfr->reqtype = dns_rdatatype_axfr;
+ xfr->state = XFRST_INITIALSOA;
+ CHECK(xfrin_send_request(xfr));
+ } else if (xfr->state == XFRST_END) {
/*
* Inform the caller we succeeded.
*/
diff --git a/usr.sbin/bind/lib/dns/zone.c b/usr.sbin/bind/lib/dns/zone.c
index b8156cf9e81..fdad910fdee 100644
--- a/usr.sbin/bind/lib/dns/zone.c
+++ b/usr.sbin/bind/lib/dns/zone.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: zone.c,v 1.333.2.23.2.59 2005/07/29 00:38:33 marka Exp $ */
+/* $ISC: zone.c,v 1.333.2.23.2.65 2006/07/19 01:04:24 marka Exp $ */
#include <config.h>
@@ -264,6 +264,7 @@ struct dns_zone {
#define DNS_ZONEFLG_FLUSH 0x00200000U
#define DNS_ZONEFLG_NOEDNS 0x00400000U
#define DNS_ZONEFLG_USEALTXFRSRC 0x00800000U
+#define DNS_ZONEFLG_SOABEFOREAXFR 0x01000000U
#define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
@@ -772,12 +773,10 @@ dns_zone_setdbtype(dns_zone_t *zone,
nomem:
if (new != NULL) {
- for (i = 0; i < dbargc; i++) {
- if (zone->db_argv[i] != NULL)
+ for (i = 0; i < dbargc; i++)
+ if (new[i] != NULL)
isc_mem_free(zone->mctx, new[i]);
- isc_mem_put(zone->mctx, new,
- dbargc * sizeof(*new));
- }
+ isc_mem_put(zone->mctx, new, dbargc * sizeof(*new));
}
result = ISC_R_NOMEMORY;
@@ -807,7 +806,7 @@ dns_zone_getview(dns_zone_t *zone) {
isc_result_t
-dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin) {
+dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin) {
isc_result_t result;
REQUIRE(DNS_ZONE_VALID(zone));
@@ -998,7 +997,7 @@ zone_load(dns_zone_t *zone, unsigned int flags) {
result = isc_file_getmodtime(zone->masterfile,
&filetime);
if (result == ISC_R_SUCCESS &&
- isc_time_compare(&filetime, &zone->loadtime) < 0) {
+ isc_time_compare(&filetime, &zone->loadtime) <= 0) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"skipping load: master file older "
"than last load");
@@ -1010,6 +1009,16 @@ zone_load(dns_zone_t *zone, unsigned int flags) {
INSIST(zone->db_argc >= 1);
+ /*
+ * Built in zones don't need to be reloaded.
+ */
+ if (zone->type == dns_zone_master &&
+ strcmp(zone->db_argv[0], "_builtin") == 0 &&
+ DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED)) {
+ result = ISC_R_SUCCESS;
+ goto cleanup;
+ }
+
if ((zone->type == dns_zone_slave || zone->type == dns_zone_stub) &&
(strcmp(zone->db_argv[0], "rbt") == 0 ||
strcmp(zone->db_argv[0], "rbt64") == 0)) {
@@ -1210,10 +1219,12 @@ zone_startload(dns_db_t *db, dns_zone_t *zone, isc_time_t loadtime) {
zone_gotreadhandle, load,
&zone->readio);
if (result != ISC_R_SUCCESS) {
- tresult = dns_db_endload(load->db,
- &load->callbacks.add_private);
- if (result == ISC_R_SUCCESS)
- result = tresult;
+ /*
+ * We can't report multiple errors so ignore
+ * the result of dns_db_endload().
+ */
+ (void)dns_db_endload(load->db,
+ &load->callbacks.add_private);
goto cleanup;
} else
result = DNS_R_CONTINUE;
@@ -1284,14 +1295,12 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
dns_zone_log(zone, ISC_LOG_DEBUG(2),
"number of nodes in database: %u",
dns_db_nodecount(db));
- zone->loadtime = loadtime;
-
- dns_zone_log(zone, ISC_LOG_DEBUG(1), "loaded");
if (result == DNS_R_SEENINCLUDE)
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HASINCLUDE);
else
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_HASINCLUDE);
+
/*
* Apply update log, if any, on initial load.
*/
@@ -1323,6 +1332,10 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
needdump = ISC_TRUE;
}
+ zone->loadtime = loadtime;
+
+ dns_zone_log(zone, ISC_LOG_DEBUG(1), "loaded");
+
/*
* Obtain ns and soa counts for top of zone.
*/
@@ -1821,7 +1834,7 @@ dns_zone_getoptions(dns_zone_t *zone) {
}
isc_result_t
-dns_zone_setxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource) {
+dns_zone_setxfrsource4(dns_zone_t *zone, const isc_sockaddr_t *xfrsource) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@@ -1838,7 +1851,7 @@ dns_zone_getxfrsource4(dns_zone_t *zone) {
}
isc_result_t
-dns_zone_setxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource) {
+dns_zone_setxfrsource6(dns_zone_t *zone, const isc_sockaddr_t *xfrsource) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@@ -1855,7 +1868,9 @@ dns_zone_getxfrsource6(dns_zone_t *zone) {
}
isc_result_t
-dns_zone_setaltxfrsource4(dns_zone_t *zone, isc_sockaddr_t *altxfrsource) {
+dns_zone_setaltxfrsource4(dns_zone_t *zone,
+ const isc_sockaddr_t *altxfrsource)
+{
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@@ -1872,7 +1887,9 @@ dns_zone_getaltxfrsource4(dns_zone_t *zone) {
}
isc_result_t
-dns_zone_setaltxfrsource6(dns_zone_t *zone, isc_sockaddr_t *altxfrsource) {
+dns_zone_setaltxfrsource6(dns_zone_t *zone,
+ const isc_sockaddr_t *altxfrsource)
+{
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@@ -1889,7 +1906,7 @@ dns_zone_getaltxfrsource6(dns_zone_t *zone) {
}
isc_result_t
-dns_zone_setnotifysrc4(dns_zone_t *zone, isc_sockaddr_t *notifysrc) {
+dns_zone_setnotifysrc4(dns_zone_t *zone, const isc_sockaddr_t *notifysrc) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@@ -1906,7 +1923,7 @@ dns_zone_getnotifysrc4(dns_zone_t *zone) {
}
isc_result_t
-dns_zone_setnotifysrc6(dns_zone_t *zone, isc_sockaddr_t *notifysrc) {
+dns_zone_setnotifysrc6(dns_zone_t *zone, const isc_sockaddr_t *notifysrc) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
@@ -1923,7 +1940,7 @@ dns_zone_getnotifysrc6(dns_zone_t *zone) {
}
isc_result_t
-dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
+dns_zone_setalsonotify(dns_zone_t *zone, const isc_sockaddr_t *notify,
isc_uint32_t count)
{
isc_sockaddr_t *new;
@@ -1953,7 +1970,7 @@ dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
}
isc_result_t
-dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
+dns_zone_setmasters(dns_zone_t *zone, const isc_sockaddr_t *masters,
isc_uint32_t count)
{
isc_result_t result;
@@ -1963,8 +1980,10 @@ dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
}
isc_result_t
-dns_zone_setmasterswithkeys(dns_zone_t *zone, isc_sockaddr_t *masters,
- dns_name_t **keynames, isc_uint32_t count)
+dns_zone_setmasterswithkeys(dns_zone_t *zone,
+ const isc_sockaddr_t *masters,
+ dns_name_t **keynames,
+ isc_uint32_t count)
{
isc_sockaddr_t *new;
isc_result_t result = ISC_R_SUCCESS;
@@ -2274,6 +2293,7 @@ dns_zone_refresh(dns_zone_t *zone) {
isc_interval_t i;
isc_uint32_t oldflags;
unsigned int j;
+ isc_result_t result;
REQUIRE(DNS_ZONE_VALID(zone));
@@ -2307,7 +2327,11 @@ dns_zone_refresh(dns_zone_t *zone) {
*/
isc_interval_set(&i, isc_random_jitter(zone->retry, zone->retry / 4),
0);
- isc_time_nowplusinterval(&zone->refreshtime, &i);
+ result = isc_time_nowplusinterval(&zone->refreshtime, &i);
+ if (result |= ISC_R_SUCCESS)
+ dns_zone_log(zone, ISC_LOG_WARNING,
+ "isc_time_nowplusinterval() failed: %s",
+ dns_result_totext(result));
/*
* When lacking user-specified timer values from the SOA,
@@ -3535,8 +3559,13 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
"master %s exceeded (source %s)",
master, source);
/* Try with slave with TCP. */
- if (zone->type == dns_zone_slave)
+ if (zone->type == dns_zone_slave) {
+ LOCK_ZONE(zone);
+ DNS_ZONE_SETFLAG(zone,
+ DNS_ZONEFLG_SOABEFOREAXFR);
+ UNLOCK_ZONE(zone);
goto tcp_transfer;
+ }
} else
dns_zone_log(zone, ISC_LOG_INFO,
"refresh: failure trying master "
@@ -3603,6 +3632,9 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
"initiating TCP zone xfer "
"for master %s (source %s)",
master, source);
+ LOCK_ZONE(zone);
+ DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_SOABEFOREAXFR);
+ UNLOCK_ZONE(zone);
goto tcp_transfer;
} else {
INSIST(zone->type == dns_zone_stub);
@@ -5515,6 +5547,7 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
LOCK_ZONE(zone);
INSIST((zone->flags & DNS_ZONEFLG_REFRESH) != 0);
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
+ DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_SOABEFOREAXFR);
TIME_NOW(&now);
switch (result) {
@@ -5868,7 +5901,10 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
"IXFR disabled, "
"requesting AXFR from %s",
mastertext);
- xfrtype = dns_rdatatype_axfr;
+ if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SOABEFOREAXFR))
+ xfrtype = dns_rdatatype_soa;
+ else
+ xfrtype = dns_rdatatype_axfr;
} else {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"requesting IXFR from %s",
diff --git a/usr.sbin/bind/lib/isc/api b/usr.sbin/bind/lib/isc/api
index ddeff334f03..b4d017358ad 100644
--- a/usr.sbin/bind/lib/isc/api
+++ b/usr.sbin/bind/lib/isc/api
@@ -1,3 +1,3 @@
-LIBINTERFACE = 11
+LIBINTERFACE = 12
LIBREVISION = 1
-LIBAGE = 0
+LIBAGE = 1
diff --git a/usr.sbin/bind/lib/isc/commandline.c b/usr.sbin/bind/lib/isc/commandline.c
index 9241b43c400..4bb46e52547 100644
--- a/usr.sbin/bind/lib/isc/commandline.c
+++ b/usr.sbin/bind/lib/isc/commandline.c
@@ -27,7 +27,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
diff --git a/usr.sbin/bind/lib/isc/hash.c b/usr.sbin/bind/lib/isc/hash.c
index da9303f21bf..e3e624b1246 100644
--- a/usr.sbin/bind/lib/isc/hash.c
+++ b/usr.sbin/bind/lib/isc/hash.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: hash.c,v 1.2.2.4.2.1 2004/03/06 08:14:29 marka Exp $ */
+/* $ISC: hash.c,v 1.2.2.4.2.3 2006/01/04 00:37:22 marka Exp $ */
/*
* Some portion of this code was derived from universal hash function
@@ -68,7 +68,6 @@ if advised of the possibility of such damage.
#include <isc/once.h>
#include <isc/random.h>
#include <isc/refcount.h>
-#include <isc/rwlock.h>
#include <isc/string.h>
#include <isc/util.h>
@@ -99,7 +98,7 @@ struct isc_hash {
hash_random_t *rndvector; /* random vector for universal hashing */
};
-static isc_rwlock_t createlock;
+static isc_mutex_t createlock;
static isc_once_t once = ISC_ONCE_INIT;
static isc_hash_t *hash = NULL;
@@ -209,7 +208,7 @@ isc_hash_ctxcreate(isc_mem_t *mctx, isc_entropy_t *entropy,
static void
initialize_lock(void) {
- RUNTIME_CHECK(isc_rwlock_init(&createlock, 0, 0) == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc_mutex_init(&createlock) == ISC_R_SUCCESS);
}
isc_result_t
@@ -221,12 +220,12 @@ isc_hash_create(isc_mem_t *mctx, isc_entropy_t *entropy, size_t limit) {
RUNTIME_CHECK(isc_once_do(&once, initialize_lock) == ISC_R_SUCCESS);
- RWLOCK(&createlock, isc_rwlocktype_write);
+ LOCK(&createlock);
if (hash == NULL)
result = isc_hash_ctxcreate(mctx, entropy, limit, &hash);
- RWUNLOCK(&createlock, isc_rwlocktype_write);
+ UNLOCK(&createlock);
return (result);
}
diff --git a/usr.sbin/bind/lib/isc/inet_aton.c b/usr.sbin/bind/lib/isc/inet_aton.c
index 0dbf24e594d..e88525b1109 100644
--- a/usr.sbin/bind/lib/isc/inet_aton.c
+++ b/usr.sbin/bind/lib/isc/inet_aton.c
@@ -27,7 +27,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
diff --git a/usr.sbin/bind/lib/isc/lex.c b/usr.sbin/bind/lib/isc/lex.c
index a54c023802c..ac355926bc6 100644
--- a/usr.sbin/bind/lib/isc/lex.c
+++ b/usr.sbin/bind/lib/isc/lex.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: lex.c,v 1.66.2.6.2.8 2004/08/28 06:25:21 marka Exp $ */
+/* $ISC: lex.c,v 1.66.2.6.2.10 2006/01/04 23:50:21 marka Exp $ */
#include <config.h>
@@ -372,9 +372,6 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
source = HEAD(lex->sources);
REQUIRE(tokenp != NULL);
- lex->saved_paren_count = lex->paren_count;
- source->saved_line = source->line;
-
if (source == NULL) {
if ((options & ISC_LEXOPT_NOMORE) != 0) {
tokenp->type = isc_tokentype_nomore;
@@ -386,6 +383,9 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
if (source->result != ISC_R_SUCCESS)
return (source->result);
+ lex->saved_paren_count = lex->paren_count;
+ source->saved_line = source->line;
+
if (isc_buffer_remaininglength(source->pushback) == 0 &&
source->at_eof)
{
@@ -633,9 +633,13 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
remaining--;
break;
case lexstate_string:
- if ((!escaped &&
- (c == ' ' || c == '\t' || lex->specials[c])) ||
- c == '\r' || c == '\n' || c == EOF) {
+ /*
+ * EOF needs to be checked before lex->specials[c]
+ * as lex->specials[EOF] is not a good idea.
+ */
+ if (c == '\r' || c == '\n' || c == EOF ||
+ (!escaped &&
+ (c == ' ' || c == '\t' || lex->specials[c]))) {
pushback(source, c);
if (source->result != ISC_R_SUCCESS) {
result = source->result;
diff --git a/usr.sbin/bind/lib/isc/log.c b/usr.sbin/bind/lib/isc/log.c
index 307de513bbc..68f27152290 100644
--- a/usr.sbin/bind/lib/isc/log.c
+++ b/usr.sbin/bind/lib/isc/log.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: log.c,v 1.70.2.8.2.12 2004/06/11 00:35:38 marka Exp $ */
+/* $ISC: log.c,v 1.70.2.8.2.14 2006/03/02 00:37:20 marka Exp $ */
/* Principal Authors: DCL */
@@ -1730,8 +1730,9 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
syslog_level = syslog_map[-level];
(void)syslog(FACILITY(channel) | syslog_level,
- "%s%s%s%s%s%s%s%s%s",
+ "%s%s%s%s%s%s%s%s%s%s",
printtime ? time_string : "",
+ printtime ? " " : "",
printtag ? lcfg->tag : "",
printtag ? ": " : "",
printcategory ? category->name : "",
diff --git a/usr.sbin/bind/lib/isc/print.c b/usr.sbin/bind/lib/isc/print.c
index e1aa7a4948c..696ad3cb7df 100644
--- a/usr.sbin/bind/lib/isc/print.c
+++ b/usr.sbin/bind/lib/isc/print.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,12 +15,15 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: print.c,v 1.22.2.3.2.3 2004/03/06 08:14:33 marka Exp $ */
+/* $ISC: print.c,v 1.22.2.3.2.4 2006/04/17 18:27:20 explorer Exp $ */
+
+/*! \file */
#include <config.h>
#include <ctype.h>
#include <stdio.h> /* for snprintf */
+#include <string.h> /* for strlen() */
#define ISC__PRINT_SOURCE /* Used to get the isc_print_* prototypes. */
@@ -41,7 +44,7 @@ isc_print_sprintf(char *str, const char *format, ...) {
return (strlen(str));
}
-/*
+/*!
* Return length of string that would have been written if not truncated.
*/
@@ -57,7 +60,7 @@ isc_print_snprintf(char *str, size_t size, const char *format, ...) {
}
-/*
+/*!
* Return length of string that would have been written if not truncated.
*/
diff --git a/usr.sbin/bind/lib/isc/sockaddr.c b/usr.sbin/bind/lib/isc/sockaddr.c
index 0bcfa03f423..1819cfda06e 100644
--- a/usr.sbin/bind/lib/isc/sockaddr.c
+++ b/usr.sbin/bind/lib/isc/sockaddr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: sockaddr.c,v 1.48.2.2 2003/10/09 07:32:49 marka Exp $ */
+/* $ISC: sockaddr.c,v 1.48.2.1.2.12 2006/03/02 00:37:20 marka Exp $ */
#include <config.h>
@@ -400,7 +400,7 @@ isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port) {
}
in_port_t
-isc_sockaddr_getport(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_getport(const isc_sockaddr_t *sockaddr) {
in_port_t port = 0;
switch (sockaddr->type.sa.sa_family) {
@@ -422,7 +422,7 @@ isc_sockaddr_getport(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
-isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_ismulticast(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
@@ -430,7 +430,7 @@ isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
-isc_sockaddr_isexperimental(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_isexperimental(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET) {
@@ -441,7 +441,7 @@ isc_sockaddr_isexperimental(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
-isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_issitelocal(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET6) {
@@ -452,7 +452,7 @@ isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
}
isc_boolean_t
-isc_sockaddr_islinklocal(isc_sockaddr_t *sockaddr) {
+isc_sockaddr_islinklocal(const isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET6) {
diff --git a/usr.sbin/bind/lib/isc/unix/entropy.c b/usr.sbin/bind/lib/isc/unix/entropy.c
index 399887599e5..b39bba0a4aa 100644
--- a/usr.sbin/bind/lib/isc/unix/entropy.c
+++ b/usr.sbin/bind/lib/isc/unix/entropy.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: entropy.c,v 1.60.2.3.8.11 2005/07/12 05:47:43 marka Exp $ */
+/* $ISC: entropy.c,v 1.60.2.3.8.14 2006/03/02 23:29:17 marka Exp $ */
/*
* This is the system depenedent part of the ISC entropy API.
@@ -127,7 +127,7 @@ get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
switch ( source->sources.usocket.status ) {
case isc_usocketsource_ndesired:
buf[0] = ndesired;
- if ((n = send(fd, buf, 1, 0)) < 0) {
+ if ((n = sendto(fd, buf, 1, 0, NULL, 0)) < 0) {
if (errno == EWOULDBLOCK || errno == EINTR ||
errno == ECONNRESET)
goto out;
@@ -142,7 +142,7 @@ get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
case isc_usocketsource_connected:
buf[0] = 1;
buf[1] = ndesired;
- if ((n = send(fd, buf, 2, 0)) < 0) {
+ if ((n = sendto(fd, buf, 2, 0, NULL, 0)) < 0) {
if (errno == EWOULDBLOCK || errno == EINTR ||
errno == ECONNRESET)
goto out;
@@ -159,12 +159,12 @@ get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
/*FALLTHROUGH*/
case isc_usocketsource_wrote:
- if (recv(fd, buf, 1, 0) != 1) {
+ if (recvfrom(fd, buf, 1, 0, NULL, NULL) != 1) {
if (errno == EAGAIN) {
/*
* The problem of EAGAIN (try again
* later) is a major issue on HP-UX.
- * Solaris actually tries the recv
+ * Solaris actually tries the recvfrom
* call again, while HP-UX just dies.
* This code is an attempt to let the
* entropy pool fill back up (at least
@@ -503,7 +503,7 @@ isc_entropy_createfilesource(isc_entropy_t *ent, const char *fname) {
if (S_ISSOCK(_stat.st_mode))
is_usocket = ISC_TRUE;
#endif
-#if defined(S_ISFIFO)
+#if defined(S_ISFIFO) && defined(sun)
if (S_ISFIFO(_stat.st_mode))
is_usocket = ISC_TRUE;
#endif
diff --git a/usr.sbin/bind/lib/isc/unix/fsaccess.c b/usr.sbin/bind/lib/isc/unix/fsaccess.c
index 24f8e2b3227..8b6250c8144 100644
--- a/usr.sbin/bind/lib/isc/unix/fsaccess.c
+++ b/usr.sbin/bind/lib/isc/unix/fsaccess.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,9 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: fsaccess.c,v 1.6.206.1 2004/03/06 08:14:59 marka Exp $ */
+/* $ISC: fsaccess.c,v 1.6.206.3 2006/08/25 05:25:50 marka Exp $ */
+
+#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/usr.sbin/bind/lib/isc/unix/ifiter_ioctl.c b/usr.sbin/bind/lib/isc/unix/ifiter_ioctl.c
index 8c418fb42df..0053d015828 100644
--- a/usr.sbin/bind/lib/isc/unix/ifiter_ioctl.c
+++ b/usr.sbin/bind/lib/isc/unix/ifiter_ioctl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: ifiter_ioctl.c,v 1.19.2.5.2.17 2005/10/14 02:13:07 marka Exp $ */
+/* $ISC: ifiter_ioctl.c,v 1.19.2.5.2.19 2006/02/03 23:51:37 marka Exp $ */
/*
* Obtain the list of network interfaces using the SIOCGLIFCONF ioctl.
@@ -529,7 +529,8 @@ internal_current4(isc_interfaceiter_t *iter) {
#endif
REQUIRE(VALID_IFITER(iter));
- REQUIRE (iter->pos < (unsigned int) iter->ifc.ifc_len);
+ REQUIRE(iter->ifc.ifc_len == 0 ||
+ iter->pos < (unsigned int) iter->ifc.ifc_len);
#ifdef __linux
result = linux_if_inet6_current(iter);
@@ -538,6 +539,9 @@ internal_current4(isc_interfaceiter_t *iter) {
iter->first = ISC_TRUE;
#endif
+ if (iter->ifc.ifc_len == 0)
+ return (ISC_R_NOMORE);
+
ifrp = (struct ifreq *)((char *) iter->ifc.ifc_req + iter->pos);
memset(&ifreq, 0, sizeof(ifreq));
diff --git a/usr.sbin/bind/lib/isc/unix/socket.c b/usr.sbin/bind/lib/isc/unix/socket.c
index c2a7468c663..128f39467ea 100644
--- a/usr.sbin/bind/lib/isc/unix/socket.c
+++ b/usr.sbin/bind/lib/isc/unix/socket.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: socket.c,v 1.207.2.19.2.22 2005/11/03 23:08:42 marka Exp $ */
+/* $ISC: socket.c,v 1.207.2.19.2.26 2006/05/19 02:53:36 marka Exp $ */
#include <config.h>
@@ -110,7 +110,7 @@ typedef isc_event_t intev_t;
* to collect the destination address and interface so the client can
* set them on outgoing packets.
*/
-#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
#ifndef USE_CMSG
#define USE_CMSG 1
#endif
@@ -750,8 +750,26 @@ build_msghdr_recv(isc_socket_t *sock, isc_socketevent_t *dev,
if (sock->type == isc_sockettype_udp) {
memset(&dev->address, 0, sizeof(dev->address));
+#ifdef BROKEN_RECVMSG
+ if (sock->pf == AF_INET) {
+ msg->msg_name = (void *)&dev->address.type.sin;
+ msg->msg_namelen = sizeof(dev->address.type.sin6);
+ } else if (sock->pf == AF_INET6) {
+ msg->msg_name = (void *)&dev->address.type.sin6;
+ msg->msg_namelen = sizeof(dev->address.type.sin6);
+#ifdef ISC_PLATFORM_HAVESYSUNH
+ } else if (sock->pf == AF_UNIX) {
+ msg->msg_name = (void *)&dev->address.type.sunix;
+ msg->msg_namelen = sizeof(dev->address.type.sunix);
+#endif
+ } else {
+ msg->msg_name = (void *)&dev->address.type.sa;
+ msg->msg_namelen = sizeof(dev->address.type);
+ }
+#else
msg->msg_name = (void *)&dev->address.type.sa;
msg->msg_namelen = sizeof(dev->address.type);
+#endif
#ifdef ISC_NET_RECVOVERFLOW
/* If needed, steal one iovec for overflow detection. */
maxiov--;
@@ -924,6 +942,10 @@ doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) {
cc = recvmsg(sock->fd, &msghdr, 0);
recv_errno = errno;
+#if defined(ISC_SOCKET_DEBUG)
+ dump_msg(&msghdr);
+#endif
+
if (cc < 0) {
if (SOFT_ERROR(recv_errno))
return (DOIO_SOFT);
@@ -2684,8 +2706,8 @@ socket_send(isc_socket_t *sock, isc_socketevent_t *dev, isc_task_t *task,
dev->attributes |= ISC_SOCKEVENTATTR_PKTINFO;
dev->pktinfo = *pktinfo;
- if (!isc_sockaddr_issitelocal(address) &&
- !isc_sockaddr_islinklocal(address)) {
+ if (!isc_sockaddr_issitelocal(&dev->address) &&
+ !isc_sockaddr_islinklocal(&dev->address)) {
socket_log(sock, NULL, TRACE, isc_msgcat,
ISC_MSGSET_SOCKET, ISC_MSG_PKTINFOPROVIDED,
"pktinfo structure provided, ifindex %u "
diff --git a/usr.sbin/bind/lib/isccc/api b/usr.sbin/bind/lib/isccc/api
index 4f115e73f2d..8c77091b90c 100644
--- a/usr.sbin/bind/lib/isccc/api
+++ b/usr.sbin/bind/lib/isccc/api
@@ -1,3 +1,3 @@
LIBINTERFACE = 2
-LIBREVISION = 1
+LIBREVISION = 2
LIBAGE = 2
diff --git a/usr.sbin/bind/lib/isccfg/parser.c b/usr.sbin/bind/lib/isccfg/parser.c
index 3f84a95ff51..2ec68979ea3 100644
--- a/usr.sbin/bind/lib/isccfg/parser.c
+++ b/usr.sbin/bind/lib/isccfg/parser.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: parser.c,v 1.70.2.20.2.18 2004/05/15 03:46:13 jinmei Exp $ */
+/* $ISC: parser.c,v 1.70.2.20.2.21 2006/02/28 06:32:54 marka Exp $ */
#include <config.h>
@@ -68,7 +68,7 @@ static isc_result_t
parse_list(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
static void
-print_list(cfg_printer_t *pctx, cfg_obj_t *obj);
+print_list(cfg_printer_t *pctx, const cfg_obj_t *obj);
static void
free_list(cfg_parser_t *pctx, cfg_obj_t *obj);
@@ -134,7 +134,7 @@ static cfg_type_t cfg_type_implicitlist = {
/* Functions. */
void
-cfg_print_obj(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_obj(cfg_printer_t *pctx, const cfg_obj_t *obj) {
obj->type->print(pctx, obj);
}
@@ -177,7 +177,7 @@ cfg_parse_obj(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
void
-cfg_print(cfg_obj_t *obj,
+cfg_print(const cfg_obj_t *obj,
void (*f)(void *closure, const char *text, int textlen),
void *closure)
{
@@ -243,14 +243,14 @@ cfg_parse_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
}
void
-cfg_print_tuple(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_tuple(cfg_printer_t *pctx, const cfg_obj_t *obj) {
unsigned int i;
const cfg_tuplefielddef_t *fields = obj->type->of;
const cfg_tuplefielddef_t *f;
isc_boolean_t need_space = ISC_FALSE;
for (f = fields, i = 0; f->name != NULL; f++, i++) {
- cfg_obj_t *fieldobj = obj->value.tuple[i];
+ const cfg_obj_t *fieldobj = obj->value.tuple[i];
if (need_space)
cfg_print_chars(pctx, " ", 1);
cfg_print_obj(pctx, fieldobj);
@@ -291,13 +291,13 @@ free_tuple(cfg_parser_t *pctx, cfg_obj_t *obj) {
}
isc_boolean_t
-cfg_obj_istuple(cfg_obj_t *obj) {
+cfg_obj_istuple(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_tuple));
}
-cfg_obj_t *
-cfg_tuple_get(cfg_obj_t *tupleobj, const char* name) {
+const cfg_obj_t *
+cfg_tuple_get(const cfg_obj_t *tupleobj, const char* name) {
unsigned int i;
const cfg_tuplefielddef_t *fields;
const cfg_tuplefielddef_t *f;
@@ -548,7 +548,7 @@ cfg_parse_void(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
void
-cfg_print_void(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_void(cfg_printer_t *pctx, const cfg_obj_t *obj) {
UNUSED(pctx);
UNUSED(obj);
}
@@ -560,7 +560,7 @@ cfg_doc_void(cfg_printer_t *pctx, const cfg_type_t *type) {
}
isc_boolean_t
-cfg_obj_isvoid(cfg_obj_t *obj) {
+cfg_obj_isvoid(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_void));
}
@@ -606,18 +606,18 @@ cfg_print_rawuint(cfg_printer_t *pctx, unsigned int u) {
}
void
-cfg_print_uint32(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_uint32(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_rawuint(pctx, obj->value.uint32);
}
isc_boolean_t
-cfg_obj_isuint32(cfg_obj_t *obj) {
+cfg_obj_isuint32(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_uint32));
}
isc_uint32_t
-cfg_obj_asuint32(cfg_obj_t *obj) {
+cfg_obj_asuint32(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_uint32);
return (obj->value.uint32);
}
@@ -632,19 +632,19 @@ cfg_type_t cfg_type_uint32 = {
* uint64
*/
isc_boolean_t
-cfg_obj_isuint64(cfg_obj_t *obj) {
+cfg_obj_isuint64(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_uint64));
}
isc_uint64_t
-cfg_obj_asuint64(cfg_obj_t *obj) {
+cfg_obj_asuint64(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_uint64);
return (obj->value.uint64);
}
void
-cfg_print_uint64(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj) {
char buf[32];
snprintf(buf, sizeof(buf), "%" ISC_PRINT_QUADFORMAT "u",
obj->value.uint64);
@@ -723,7 +723,9 @@ parse_ustring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
}
isc_result_t
-cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
+cfg_parse_astring(cfg_parser_t *pctx, const cfg_type_t *type,
+ cfg_obj_t **ret)
+{
isc_result_t result;
UNUSED(type);
@@ -781,12 +783,12 @@ cfg_doc_enum(cfg_printer_t *pctx, const cfg_type_t *type) {
}
void
-cfg_print_ustring(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_ustring(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_chars(pctx, obj->value.string.base, obj->value.string.length);
}
static void
-print_qstring(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_qstring(cfg_printer_t *pctx, const cfg_obj_t *obj) {
cfg_print_chars(pctx, "\"", 1);
cfg_print_ustring(pctx, obj);
cfg_print_chars(pctx, "\"", 1);
@@ -799,13 +801,13 @@ free_string(cfg_parser_t *pctx, cfg_obj_t *obj) {
}
isc_boolean_t
-cfg_obj_isstring(cfg_obj_t *obj) {
+cfg_obj_isstring(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_string));
}
-char *
-cfg_obj_asstring(cfg_obj_t *obj) {
+const char *
+cfg_obj_asstring(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_string);
return (obj->value.string.base);
}
@@ -833,13 +835,13 @@ cfg_type_t cfg_type_astring = {
*/
isc_boolean_t
-cfg_obj_isboolean(cfg_obj_t *obj) {
+cfg_obj_isboolean(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_boolean));
}
isc_boolean_t
-cfg_obj_asboolean(cfg_obj_t *obj) {
+cfg_obj_asboolean(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_boolean);
return (obj->value.boolean);
}
@@ -885,7 +887,7 @@ parse_boolean(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
}
static void
-print_boolean(cfg_printer_t *pctx, cfg_obj_t *obj) {
+print_boolean(cfg_printer_t *pctx, const cfg_obj_t *obj) {
if (obj->value.boolean)
cfg_print_chars(pctx, "yes", 3);
else
@@ -999,9 +1001,9 @@ parse_list(cfg_parser_t *pctx, const cfg_type_t *listtype, cfg_obj_t **ret)
}
static void
-print_list(cfg_printer_t *pctx, cfg_obj_t *obj) {
- cfg_list_t *list = &obj->value.list;
- cfg_listelt_t *elt;
+print_list(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+ const cfg_list_t *list = &obj->value.list;
+ const cfg_listelt_t *elt;
for (elt = ISC_LIST_HEAD(*list);
elt != NULL;
@@ -1025,7 +1027,7 @@ cfg_parse_bracketed_list(cfg_parser_t *pctx, const cfg_type_t *type,
}
void
-cfg_print_bracketed_list(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_bracketed_list(cfg_printer_t *pctx, const cfg_obj_t *obj) {
print_open(pctx);
print_list(pctx, obj);
print_close(pctx);
@@ -1072,9 +1074,9 @@ cfg_parse_spacelist(cfg_parser_t *pctx, const cfg_type_t *listtype,
}
void
-cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj) {
- cfg_list_t *list = &obj->value.list;
- cfg_listelt_t *elt;
+cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+ const cfg_list_t *list = &obj->value.list;
+ const cfg_listelt_t *elt;
for (elt = ISC_LIST_HEAD(*list);
elt != NULL;
@@ -1087,27 +1089,27 @@ cfg_print_spacelist(cfg_printer_t *pctx, cfg_obj_t *obj) {
isc_boolean_t
-cfg_obj_islist(cfg_obj_t *obj) {
+cfg_obj_islist(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_list));
}
-cfg_listelt_t *
-cfg_list_first(cfg_obj_t *obj) {
+const cfg_listelt_t *
+cfg_list_first(const cfg_obj_t *obj) {
REQUIRE(obj == NULL || obj->type->rep == &cfg_rep_list);
if (obj == NULL)
return (NULL);
return (ISC_LIST_HEAD(obj->value.list));
}
-cfg_listelt_t *
-cfg_list_next(cfg_listelt_t *elt) {
+const cfg_listelt_t *
+cfg_list_next(const cfg_listelt_t *elt) {
REQUIRE(elt != NULL);
return (ISC_LIST_NEXT(elt, link));
}
-cfg_obj_t *
-cfg_listelt_value(cfg_listelt_t *elt) {
+const cfg_obj_t *
+cfg_listelt_value(const cfg_listelt_t *elt) {
REQUIRE(elt != NULL);
return (elt->obj);
}
@@ -1366,7 +1368,7 @@ cfg_parse_addressed_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **
}
void
-cfg_print_mapbody(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_clausedef_t * const *clauseset;
@@ -1446,7 +1448,7 @@ static struct flagtext {
};
void
-cfg_print_map(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj) {
if (obj->value.map.id != NULL) {
cfg_print_obj(pctx, obj->value.map.id);
cfg_print_chars(pctx, " ", 1);
@@ -1505,16 +1507,16 @@ cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
}
isc_boolean_t
-cfg_obj_ismap(cfg_obj_t *obj) {
+cfg_obj_ismap(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_map));
}
isc_result_t
-cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj) {
+cfg_map_get(const cfg_obj_t *mapobj, const char* name, const cfg_obj_t **obj) {
isc_result_t result;
isc_symvalue_t val;
- cfg_map_t *map;
+ const cfg_map_t *map;
REQUIRE(mapobj != NULL && mapobj->type->rep == &cfg_rep_map);
REQUIRE(name != NULL);
@@ -1529,8 +1531,8 @@ cfg_map_get(cfg_obj_t *mapobj, const char* name, cfg_obj_t **obj) {
return (ISC_R_SUCCESS);
}
-cfg_obj_t *
-cfg_map_getname(cfg_obj_t *mapobj) {
+const cfg_obj_t *
+cfg_map_getname(const cfg_obj_t *mapobj) {
REQUIRE(mapobj != NULL && mapobj->type->rep == &cfg_rep_map);
return (mapobj->value.map.id);
}
@@ -1556,12 +1558,19 @@ parse_token(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
isc_lex_getlasttokentext(pctx->lexer, &pctx->token, &r);
obj->value.string.base = isc_mem_get(pctx->mctx, r.length + 1);
+ if (obj->value.string.base == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto cleanup;
+ }
obj->value.string.length = r.length;
memcpy(obj->value.string.base, r.base, r.length);
obj->value.string.base[r.length] = '\0';
*ret = obj;
+ return (result);
cleanup:
+ if (obj != NULL)
+ isc_mem_put(pctx->mctx, obj, sizeof(*obj));
return (result);
}
@@ -1753,7 +1762,7 @@ cfg_parse_rawport(cfg_parser_t *pctx, unsigned int flags, in_port_t *port) {
}
void
-cfg_print_rawaddr(cfg_printer_t *pctx, isc_netaddr_t *na) {
+cfg_print_rawaddr(cfg_printer_t *pctx, const isc_netaddr_t *na) {
isc_result_t result;
char text[128];
isc_buffer_t buf;
@@ -1843,21 +1852,22 @@ cfg_parse_netprefix(cfg_parser_t *pctx, const cfg_type_t *type,
}
static void
-print_netprefix(cfg_printer_t *pctx, cfg_obj_t *obj) {
- cfg_netprefix_t *p = &obj->value.netprefix;
+print_netprefix(cfg_printer_t *pctx, const cfg_obj_t *obj) {
+ const cfg_netprefix_t *p = &obj->value.netprefix;
+
cfg_print_rawaddr(pctx, &p->address);
cfg_print_chars(pctx, "/", 1);
cfg_print_rawuint(pctx, p->prefixlen);
}
isc_boolean_t
-cfg_obj_isnetprefix(cfg_obj_t *obj) {
+cfg_obj_isnetprefix(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_netprefix));
}
void
-cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
+cfg_obj_asnetprefix(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
unsigned int *prefixlen) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_netprefix);
*netaddr = obj->value.netprefix.address;
@@ -1908,7 +1918,7 @@ cfg_parse_sockaddr(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret)
}
void
-cfg_print_sockaddr(cfg_printer_t *pctx, cfg_obj_t *obj) {
+cfg_print_sockaddr(cfg_printer_t *pctx, const cfg_obj_t *obj) {
isc_netaddr_t netaddr;
in_port_t port;
char buf[ISC_NETADDR_FORMATSIZE];
@@ -1929,8 +1939,6 @@ cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type) {
int n = 0;
cfg_print_chars(pctx, "( ", 2);
if (*flagp & CFG_ADDR_V4OK) {
- if (n != 0)
- cfg_print_chars(pctx, " | ", 3);
cfg_print_cstr(pctx, "<ipv4_address>");
n++;
}
@@ -1955,13 +1963,13 @@ cfg_doc_sockaddr(cfg_printer_t *pctx, const cfg_type_t *type) {
}
isc_boolean_t
-cfg_obj_issockaddr(cfg_obj_t *obj) {
+cfg_obj_issockaddr(const cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_sockaddr));
}
-isc_sockaddr_t *
-cfg_obj_assockaddr(cfg_obj_t *obj) {
+const isc_sockaddr_t *
+cfg_obj_assockaddr(const cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_sockaddr);
return (&obj->value.sockaddr);
}
@@ -2158,7 +2166,8 @@ parser_complain(cfg_parser_t *pctx, isc_boolean_t is_warning,
}
void
-cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...) {
+cfg_obj_log(const cfg_obj_t *obj, isc_log_t *lctx, int level,
+ const char *fmt, ...) {
va_list ap;
char msgbuf[2048];
@@ -2176,12 +2185,12 @@ cfg_obj_log(cfg_obj_t *obj, isc_log_t *lctx, int level, const char *fmt, ...) {
}
const char *
-cfg_obj_file(cfg_obj_t *obj) {
+cfg_obj_file(const cfg_obj_t *obj) {
return (obj->file);
}
unsigned int
-cfg_obj_line(cfg_obj_t *obj) {
+cfg_obj_line(const cfg_obj_t *obj) {
return (obj->line);
}
@@ -2223,7 +2232,6 @@ create_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
CHECK(isc_symtab_create(pctx->mctx, 5, /* XXX */
map_symtabitem_destroy,
pctx, ISC_FALSE, &symtab));
-
obj->value.map.symtab = symtab;
obj->value.map.id = NULL;
@@ -2243,7 +2251,7 @@ free_map(cfg_parser_t *pctx, cfg_obj_t *obj) {
}
isc_boolean_t
-cfg_obj_istype(cfg_obj_t *obj, const cfg_type_t *type) {
+cfg_obj_istype(const cfg_obj_t *obj, const cfg_type_t *type) {
return (ISC_TF(obj->type == type));
}
diff --git a/usr.sbin/bind/lib/lwres/getaddrinfo.c b/usr.sbin/bind/lib/lwres/getaddrinfo.c
index 2835c5cb8ae..b7f78f984c3 100644
--- a/usr.sbin/bind/lib/lwres/getaddrinfo.c
+++ b/usr.sbin/bind/lib/lwres/getaddrinfo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* This code is derived from software contributed to ISC by
@@ -18,7 +18,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: getaddrinfo.c,v 1.41.206.3 2005/06/09 23:54:33 marka Exp $ */
+/* $ISC: getaddrinfo.c,v 1.41.206.6 2006/11/13 11:57:41 marka Exp $ */
#include <config.h>
@@ -324,8 +324,10 @@ lwres_getaddrinfo(const char *hostname, const char *servname,
NULL, 0,
NI_NUMERICHOST) == 0) {
ai->ai_canonname = strdup(nbuf);
- if (ai->ai_canonname == NULL)
+ if (ai->ai_canonname == NULL) {
+ lwres_freeaddrinfo(ai_list);
return (EAI_MEMORY);
+ }
} else {
/* XXX raise error? */
ai->ai_canonname = NULL;
@@ -434,7 +436,7 @@ static char v4_loop[4] = { 127, 0, 0, 1 };
* The test against 0 is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
-#define ERR(code) \
+#define SETERROR(code) \
do { result = (code); \
if (result != 0) goto cleanup; \
} while (0)
@@ -452,13 +454,13 @@ add_ipv4(const char *hostname, int flags, struct addrinfo **aip,
lwres = lwres_context_create(&lwrctx, NULL, NULL, NULL, 0);
if (lwres != LWRES_R_SUCCESS)
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
(void) lwres_conf_parse(lwrctx, lwres_resolv_conf);
if (hostname == NULL && (flags & AI_PASSIVE) == 0) {
ai = ai_clone(*aip, AF_INET);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
@@ -472,14 +474,14 @@ add_ipv4(const char *hostname, int flags, struct addrinfo **aip,
if (lwres == LWRES_R_NOTFOUND)
goto cleanup;
else
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
}
addr = LWRES_LIST_HEAD(by->addrs);
while (addr != NULL) {
ai = ai_clone(*aip, AF_INET);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
ai->ai_socktype = socktype;
@@ -489,7 +491,7 @@ add_ipv4(const char *hostname, int flags, struct addrinfo **aip,
if (flags & AI_CANONNAME) {
ai->ai_canonname = strdup(by->realname);
if (ai->ai_canonname == NULL)
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
addr = LWRES_LIST_NEXT(addr, link);
}
@@ -519,14 +521,14 @@ add_ipv6(const char *hostname, int flags, struct addrinfo **aip,
lwres = lwres_context_create(&lwrctx, NULL, NULL, NULL, 0);
if (lwres != LWRES_R_SUCCESS)
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
(void) lwres_conf_parse(lwrctx, lwres_resolv_conf);
if (hostname == NULL && (flags & AI_PASSIVE) == 0) {
ai = ai_clone(*aip, AF_INET6);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
@@ -540,14 +542,14 @@ add_ipv6(const char *hostname, int flags, struct addrinfo **aip,
if (lwres == LWRES_R_NOTFOUND)
goto cleanup;
else
- ERR(EAI_FAIL);
+ SETERROR(EAI_FAIL);
}
addr = LWRES_LIST_HEAD(by->addrs);
while (addr != NULL) {
ai = ai_clone(*aip, AF_INET6);
if (ai == NULL) {
lwres_freeaddrinfo(*aip);
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
*aip = ai;
ai->ai_socktype = socktype;
@@ -557,7 +559,7 @@ add_ipv6(const char *hostname, int flags, struct addrinfo **aip,
if (flags & AI_CANONNAME) {
ai->ai_canonname = strdup(by->realname);
if (ai->ai_canonname == NULL)
- ERR(EAI_MEMORY);
+ SETERROR(EAI_MEMORY);
}
addr = LWRES_LIST_NEXT(addr, link);
}
diff --git a/usr.sbin/bind/lib/lwres/herror.c b/usr.sbin/bind/lib/lwres/herror.c
index c5b018b511b..f138408d49e 100644
--- a/usr.sbin/bind/lib/lwres/herror.c
+++ b/usr.sbin/bind/lib/lwres/herror.c
@@ -27,7 +27,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
diff --git a/usr.sbin/bind/lib/lwres/lwconfig.c b/usr.sbin/bind/lib/lwres/lwconfig.c
index 2e19683bf70..7c10e18fef5 100644
--- a/usr.sbin/bind/lib/lwres/lwconfig.c
+++ b/usr.sbin/bind/lib/lwres/lwconfig.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: lwconfig.c,v 1.33.2.1.2.8 2005/06/08 02:35:21 marka Exp $ */
+/* $ISC: lwconfig.c,v 1.33.2.1.2.10 2006/10/03 23:50:50 marka Exp $ */
/***
*** Module for parsing resolv.conf files.
@@ -561,7 +561,7 @@ lwres_conf_parse(lwres_context_t *ctx, const char *filename) {
errno = 0;
if ((fp = fopen(filename, "r")) == NULL)
- return (LWRES_R_FAILURE);
+ return (LWRES_R_NOTFOUND);
ret = LWRES_R_SUCCESS;
do {
diff --git a/usr.sbin/bind/lib/lwres/lwinetaton.c b/usr.sbin/bind/lib/lwres/lwinetaton.c
index dd84c2eefcb..923034986da 100644
--- a/usr.sbin/bind/lib/lwres/lwinetaton.c
+++ b/usr.sbin/bind/lib/lwres/lwinetaton.c
@@ -27,7 +27,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
diff --git a/usr.sbin/bind/lib/lwres/man/lwres.html b/usr.sbin/bind/lib/lwres/man/lwres.html
index 65caec32b79..030d57a01c9 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres.html,v 1.4.2.1.4.9 2005/10/13 02:33:54 marka Exp $ -->
+<!-- $ISC: lwres.html,v 1.4.2.1.4.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres &#8212; introduction to the lightweight resolver library</p>
@@ -32,7 +32,7 @@
<div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre></div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525832"></a><h2>DESCRIPTION</h2>
+<a name="id2549397"></a><h2>DESCRIPTION</h2>
<p>
The BIND 9 lightweight resolver library is a simple, name service
independent stub resolver library. It provides hostname-to-address
@@ -47,7 +47,7 @@ UDP-based protocol.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525845"></a><h2>OVERVIEW</h2>
+<a name="id2549410"></a><h2>OVERVIEW</h2>
<p>
The lwresd library implements multiple name service APIs.
The standard
@@ -101,7 +101,7 @@ and servers is outlined in the following sections.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525909"></a><h2>CLIENT-SIDE LOW-LEVEL API CALL FLOW</h2>
+<a name="id2549474"></a><h2>CLIENT-SIDE LOW-LEVEL API CALL FLOW</h2>
<p>
When a client program wishes to make an lwres request using the
native low-level API, it typically performs the following
@@ -147,7 +147,7 @@ packet specific information contained in the body.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526056"></a><h2>SERVER-SIDE LOW-LEVEL API CALL FLOW</h2>
+<a name="id2549689"></a><h2>SERVER-SIDE LOW-LEVEL API CALL FLOW</h2>
<p>
When implementing the server side of the lightweight resolver
protocol using the lwres library, a sequence of actions like the
@@ -188,7 +188,7 @@ set.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526141"></a><h2>SEE ALSO</h2>
+<a name="id2549774"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres_gethostent</span>(3)</span>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_buffer.html b/usr.sbin/bind/lib/lwres/man/lwres_buffer.html
index 601ad2b9541..c899b643b25 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_buffer.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_buffer.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_buffer.html,v 1.4.2.1.4.8 2005/10/13 02:33:55 marka Exp $ -->
+<!-- $ISC: lwres_buffer.html,v 1.4.2.1.4.10 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_buffer</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_buffer_init, lwres_buffer_invalidate, lwres_buffer_add, lwres_buffer_subtract, lwres_buffer_clear, lwres_buffer_first, lwres_buffer_forward, lwres_buffer_back, lwres_buffer_getuint8, lwres_buffer_putuint8, lwres_buffer_getuint16, lwres_buffer_putuint16, lwres_buffer_getuint32, lwres_buffer_putuint32, lwres_buffer_putmem, lwres_buffer_getmem &#8212; lightweight resolver buffer management</p>
@@ -49,18 +49,31 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_buffer_invalidate</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -72,6 +85,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -87,26 +105,47 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_buffer_clear</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_buffer_first</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -118,6 +157,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -133,18 +177,31 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
lwres_uint8_t
<b class="fsfunc">lwres_buffer_getuint8</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -156,18 +213,31 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
lwres_uint16_t
<b class="fsfunc">lwres_buffer_getuint16</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -179,18 +249,31 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
lwres_uint32_t
<b class="fsfunc">lwres_buffer_getuint32</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -202,6 +285,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -222,6 +310,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -242,6 +335,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -249,7 +347,7 @@ void
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2526109"></a><h2>DESCRIPTION</h2>
+<a name="id2549674"></a><h2>DESCRIPTION</h2>
<p>
These functions provide bounds checked access to a region of memory
where data is being read or written.
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_config.html b/usr.sbin/bind/lib/lwres/man/lwres_config.html
index 769fe18f80c..f2c66c0b387 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_config.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_config.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_config.html,v 1.4.2.1.4.9 2005/10/13 02:33:55 marka Exp $ -->
+<!-- $ISC: lwres_config.html,v 1.4.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_config</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get &#8212; lightweight resolver configuration</p>
@@ -31,22 +31,38 @@
<h2>Synopsis</h2>
<div class="funcsynopsis">
<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_conf_init</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_conf_clear</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -58,6 +74,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -73,22 +94,35 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
<td><code class="funcdef">
lwres_conf_t *
<b class="fsfunc">lwres_conf_get</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525910"></a><h2>DESCRIPTION</h2>
+<a name="id2549475"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_conf_init()</code>
creates an empty
@@ -125,7 +159,7 @@ to the
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525981"></a><h2>RETURN VALUES</h2>
+<a name="id2549546"></a><h2>RETURN VALUES</h2>
<p>
<code class="function">lwres_conf_parse()</code>
returns
@@ -150,14 +184,14 @@ If this happens, the function returns
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526021"></a><h2>SEE ALSO</h2>
+<a name="id2549586"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">stdio</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526048"></a><h2>FILES</h2>
+<a name="id2549612"></a><h2>FILES</h2>
<p>
<code class="filename">/etc/resolv.conf</code>
</p>
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_context.3 b/usr.sbin/bind/lib/lwres/man/lwres_context.3
index 9638e164003..9efe5175e82 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_context.3
+++ b/usr.sbin/bind/lib/lwres/man/lwres_context.3
@@ -13,14 +13,17 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $ISC: lwres_context.3,v 1.13.2.2.2.6 2005/10/13 02:33:52 marka Exp $
+.\" $ISC: lwres_context.3,v 1.13.2.2.2.7 2006/06/29 13:02:31 marka Exp $
.\"
.hy 0
.ad l
-.\" ** You probably do not want to edit this file directly **
-.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
-.\" Instead of manually editing it, you probably should edit the DocBook XML
-.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
+.\" Title: lwres_context
+.\" Author:
+.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
+.\" Date: Jun 30, 2000
+.\" Manual: BIND9
+.\" Source: BIND9
+.\"
.TH "LWRES_CONTEXT" "3" "Jun 30, 2000" "BIND9" "BIND9"
.\" disable hyphenation
.nh
@@ -33,19 +36,19 @@ lwres_context_create, lwres_context_destroy, lwres_context_nextserial, lwres_con
#include <lwres/lwres.h>
.fi
.HP 36
-\fBlwres_result_t\ \fBlwres_context_create\fR\fR\fB(\fR\fBlwres_context_t\ **contextp\fR\fB, \fR\fBvoid\ *arg\fR\fB, \fR\fBlwres_malloc_t\ malloc_function\fR\fB, \fR\fBlwres_free_t\ free_function\fR\fB);\fR
+.BI "lwres_result_t lwres_context_create(lwres_context_t\ **contextp, void\ *arg, lwres_malloc_t\ malloc_function, lwres_free_t\ free_function);"
.HP 37
-\fBlwres_result_t\ \fBlwres_context_destroy\fR\fR\fB(\fR\fBlwres_context_t\ **contextp\fR\fB);\fR
+.BI "lwres_result_t lwres_context_destroy(lwres_context_t\ **contextp);"
.HP 30
-\fBvoid\ \fBlwres_context_initserial\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBlwres_uint32_t\ serial\fR\fB);\fR
+.BI "void lwres_context_initserial(lwres_context_t\ *ctx, lwres_uint32_t\ serial);"
.HP 40
-\fBlwres_uint32_t\ \fBlwres_context_nextserial\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB);\fR
+.BI "lwres_uint32_t lwres_context_nextserial(lwres_context_t\ *ctx);"
.HP 27
-\fBvoid\ \fBlwres_context_freemem\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBvoid\ *mem\fR\fB, \fR\fBsize_t\ len\fR\fB);\fR
+.BI "void lwres_context_freemem(lwres_context_t\ *ctx, void\ *mem, size_t\ len);"
.HP 28
-\fBvoid\ \fBlwres_context_allocmem\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBsize_t\ len\fR\fB);\fR
+.BI "void lwres_context_allocmem(lwres_context_t\ *ctx, size_t\ len);"
.HP 30
-\fBvoid\ *\ \fBlwres_context_sendrecv\fR\fR\fB(\fR\fBlwres_context_t\ *ctx\fR\fB, \fR\fBvoid\ *sendbase\fR\fB, \fR\fBint\ sendlen\fR\fB, \fR\fBvoid\ *recvbase\fR\fB, \fR\fBint\ recvlen\fR\fB, \fR\fBint\ *recvd_len\fR\fB);\fR
+.BI "void * lwres_context_sendrecv(lwres_context_t\ *ctx, void\ *sendbase, int\ sendlen, void\ *recvbase, int\ recvlen, int\ *recvd_len);"
.SH "DESCRIPTION"
.PP
\fBlwres_context_create()\fR
@@ -159,3 +162,5 @@ times out waiting for a response.
\fBlwres_conf_init\fR(3),
\fBmalloc\fR(3),
\fBfree\fR(3 ).
+.SH "COPYRIGHT"
+Copyright \(co 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_context.html b/usr.sbin/bind/lib/lwres/man/lwres_context.html
index a56e94574ff..7efc75def8e 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_context.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_context.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_context.html,v 1.5.2.2.2.10 2005/10/13 02:33:55 marka Exp $ -->
+<!-- $ISC: lwres_context.html,v 1.5.2.2.2.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_context</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_context_create, lwres_context_destroy, lwres_context_nextserial, lwres_context_initserial, lwres_context_freemem, lwres_context_allocmem, lwres_context_sendrecv &#8212; lightweight resolver context management</p>
@@ -52,18 +52,31 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
lwres_result_t
<b class="fsfunc">lwres_context_destroy</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -75,18 +88,31 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
lwres_uint32_t
<b class="fsfunc">lwres_context_nextserial</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -103,6 +129,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -118,6 +149,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -153,6 +189,11 @@ void *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -160,7 +201,7 @@ void *
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525975"></a><h2>DESCRIPTION</h2>
+<a name="id2549540"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_context_create()</code>
creates a
@@ -290,7 +331,7 @@ returned in
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526156"></a><h2>RETURN VALUES</h2>
+<a name="id2549789"></a><h2>RETURN VALUES</h2>
<p>
<code class="function">lwres_context_create()</code>
returns
@@ -321,7 +362,7 @@ times out waiting for a response.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526208"></a><h2>SEE ALSO</h2>
+<a name="id2549841"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres_conf_init</span>(3)</span>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_gabn.html b/usr.sbin/bind/lib/lwres/man/lwres_gabn.html
index bd5a2a4d186..41ab93f9130 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_gabn.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_gabn.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_gabn.html,v 1.6.2.1.4.9 2005/10/13 02:33:55 marka Exp $ -->
+<!-- $ISC: lwres_gabn.html,v 1.6.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_gabn</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free &#8212; lightweight resolver getaddrbyname message handling</p>
@@ -52,6 +52,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -77,6 +82,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -102,6 +112,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -127,6 +142,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -142,6 +162,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -157,6 +182,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -164,7 +194,7 @@ void
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525963"></a><h2>DESCRIPTION</h2>
+<a name="id2549528"></a><h2>DESCRIPTION</h2>
<p>
These are low-level routines for creating and parsing
lightweight resolver name-to-address lookup request and
@@ -279,7 +309,7 @@ structures is also discarded.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526155"></a><h2>RETURN VALUES</h2>
+<a name="id2549720"></a><h2>RETURN VALUES</h2>
<p>
The getaddrbyname opcode functions
<code class="function">lwres_gabnrequest_render()</code>,
@@ -317,7 +347,7 @@ indicate that the packet is not a response to an earlier query.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526220"></a><h2>SEE ALSO</h2>
+<a name="id2549853"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3
)</span>
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_gai_strerror.html b/usr.sbin/bind/lib/lwres/man/lwres_gai_strerror.html
index e351aefa417..c31fd7c409c 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_gai_strerror.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_gai_strerror.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_gai_strerror.html,v 1.5.2.1.4.9 2005/10/13 02:33:55 marka Exp $ -->
+<!-- $ISC: lwres_gai_strerror.html,v 1.5.2.1.4.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_gai_strerror</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>gai_strerror &#8212; print suitable error string</p>
@@ -37,7 +37,7 @@ char *
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525843"></a><h2>DESCRIPTION</h2>
+<a name="id2549408"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_gai_strerror()</code>
returns an error message corresponding to an error code returned by
@@ -109,7 +109,7 @@ used by
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526040"></a><h2>SEE ALSO</h2>
+<a name="id2549605"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">strerror</span>(3)</span>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_getaddrinfo.html b/usr.sbin/bind/lib/lwres/man/lwres_getaddrinfo.html
index f25816a2699..e9d2f0c5c7a 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_getaddrinfo.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_getaddrinfo.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_getaddrinfo.html,v 1.8.2.1.4.10 2005/10/13 02:33:56 marka Exp $ -->
+<!-- $ISC: lwres_getaddrinfo.html,v 1.8.2.1.4.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_getaddrinfo</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_getaddrinfo, lwres_freeaddrinfo &#8212; socket address structure to host and service name</p>
@@ -52,18 +52,31 @@ int
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_freeaddrinfo</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
</div>
<p>
If the operating system does not provide a
@@ -87,7 +100,7 @@ struct addrinfo {
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525883"></a><h2>DESCRIPTION</h2>
+<a name="id2549448"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_getaddrinfo()</code>
is used to get a list of IP addresses and port numbers for host
@@ -284,7 +297,7 @@ created by a call to
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526309"></a><h2>RETURN VALUES</h2>
+<a name="id2549874"></a><h2>RETURN VALUES</h2>
<p>
<code class="function">lwres_getaddrinfo()</code>
returns zero on success or one of the error codes listed in
@@ -304,7 +317,7 @@ returns
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526347"></a><h2>SEE ALSO</h2>
+<a name="id2549912"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_gethostent.html b/usr.sbin/bind/lib/lwres/man/lwres_gethostent.html
index 8558e30bee5..0413d459fb0 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_gethostent.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_gethostent.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_gethostent.html,v 1.8.2.1.4.8 2005/10/13 02:33:56 marka Exp $ -->
+<!-- $ISC: lwres_gethostent.html,v 1.8.2.1.4.10 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_gethostent</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_gethostbyname, lwres_gethostbyname2, lwres_gethostbyaddr, lwres_gethostent, lwres_sethostent, lwres_endhostent, lwres_gethostbyname_r, lwres_gethostbyaddr_r, lwres_gethostent_r, lwres_sethostent_r, lwres_endhostent_r &#8212; lightweight resolver get network host entry</p>
@@ -31,14 +31,22 @@
<h2>Synopsis</h2>
<div class="funcsynopsis">
<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
+<tr>
<td><code class="funcdef">
struct hostent *
<b class="fsfunc">lwres_gethostbyname</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
@@ -50,6 +58,11 @@ struct hostent *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -70,6 +83,11 @@ struct hostent *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -109,6 +127,11 @@ struct hostent *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -149,6 +172,11 @@ struct hostent *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -174,6 +202,11 @@ struct hostent *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -187,7 +220,7 @@ void
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2526041"></a><h2>DESCRIPTION</h2>
+<a name="id2549606"></a><h2>DESCRIPTION</h2>
<p>
These functions provide hostname-to-address and
address-to-hostname lookups by means of the lightweight resolver.
@@ -324,7 +357,7 @@ calls to <code class="function">lwres_gethostbyaddr_r()</code> return
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526380"></a><h2>RETURN VALUES</h2>
+<a name="id2550013"></a><h2>RETURN VALUES</h2>
<p>
The functions
<code class="function">lwres_gethostbyname()</code>,
@@ -391,7 +424,7 @@ hostent</span>. If <em class="parameter"><code>buf</code></em> was too small, b
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526540"></a><h2>SEE ALSO</h2>
+<a name="id2550173"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">gethostent</span>(3)</span>,
@@ -402,7 +435,7 @@ hostent</span>. If <em class="parameter"><code>buf</code></em> was too small, b
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526644"></a><h2>BUGS</h2>
+<a name="id2550209"></a><h2>BUGS</h2>
<p>
<code class="function">lwres_gethostbyname()</code>,
<code class="function">lwres_gethostbyname2()</code>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_getipnode.3 b/usr.sbin/bind/lib/lwres/man/lwres_getipnode.3
index 7ea20b8bf45..f044c1cc4c3 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_getipnode.3
+++ b/usr.sbin/bind/lib/lwres/man/lwres_getipnode.3
@@ -13,14 +13,17 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $ISC: lwres_getipnode.3,v 1.13.2.2.4.6 2005/10/13 02:33:53 marka Exp $
+.\" $ISC: lwres_getipnode.3,v 1.13.2.2.4.7 2006/06/29 13:02:31 marka Exp $
.\"
.hy 0
.ad l
-.\" ** You probably do not want to edit this file directly **
-.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
-.\" Instead of manually editing it, you probably should edit the DocBook XML
-.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
+.\" Title: lwres_getipnode
+.\" Author:
+.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
+.\" Date: Jun 30, 2000
+.\" Manual: BIND9
+.\" Source: BIND9
+.\"
.TH "LWRES_GETIPNODE" "3" "Jun 30, 2000" "BIND9" "BIND9"
.\" disable hyphenation
.nh
@@ -33,11 +36,11 @@ lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent \- lightweight r
#include <lwres/netdb.h>
.fi
.HP 39
-\fBstruct\ hostent\ *\ \fBlwres_getipnodebyname\fR\fR\fB(\fR\fBconst\ char\ *name\fR\fB, \fR\fBint\ af\fR\fB, \fR\fBint\ flags\fR\fB, \fR\fBint\ *error_num\fR\fB);\fR
+.BI "struct hostent * lwres_getipnodebyname(const\ char\ *name, int\ af, int\ flags, int\ *error_num);"
.HP 39
-\fBstruct\ hostent\ *\ \fBlwres_getipnodebyaddr\fR\fR\fB(\fR\fBconst\ void\ *src\fR\fB, \fR\fBsize_t\ len\fR\fB, \fR\fBint\ af\fR\fB, \fR\fBint\ *error_num\fR\fB);\fR
+.BI "struct hostent * lwres_getipnodebyaddr(const\ void\ *src, size_t\ len, int\ af, int\ *error_num);"
.HP 23
-\fBvoid\ \fBlwres_freehostent\fR\fR\fB(\fR\fBstruct\ hostent\ *he\fR\fB);\fR
+.BI "void lwres_freehostent(struct\ hostent\ *he);"
.SH "DESCRIPTION"
.PP
These functions perform thread safe, protocol independent nodename\-to\-address and address\-to\-nodename translation as defined in RFC2553.
@@ -47,6 +50,7 @@ They use a
which is defined in
\fInamedb.h\fR:
.sp
+.RS 3n
.nf
struct hostent {
char *h_name; /* official name of host */
@@ -57,25 +61,26 @@ struct hostent {
};
#define h_addr h_addr_list[0] /* address, for backward compatibility */
.fi
+.RE
.sp
.PP
The members of this structure are:
-.TP
+.TP 3n
\fBh_name\fR
The official (canonical) name of the host.
-.TP
+.TP 3n
\fBh_aliases\fR
A NULL\-terminated array of alternate names (nicknames) for the host.
-.TP
+.TP 3n
\fBh_addrtype\fR
The type of address being returned \- usually
\fBPF_INET\fR
or
\fBPF_INET6\fR.
-.TP
+.TP 3n
\fBh_length\fR
The length of the address in bytes.
-.TP
+.TP 3n
\fBh_addr_list\fR
A
\fBNULL\fR
@@ -88,20 +93,20 @@ for the hostname
\fIname\fR. The
\fIflags\fR
parameter contains ORed flag bits to specify the types of addresses that are searched for, and the types of addresses that are returned. The flag bits are:
-.TP
+.TP 3n
\fBAI_V4MAPPED\fR
This is used with an
\fIaf\fR
of AF_INET6, and causes IPv4 addresses to be returned as IPv4\-mapped IPv6 addresses.
-.TP
+.TP 3n
\fBAI_ALL\fR
This is used with an
\fIaf\fR
of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned. If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped IPv6 addresses.
-.TP
+.TP 3n
\fBAI_ADDRCONFIG\fR
Only return an IPv6 or IPv4 address if here is an active network interface of that type. This is not currently implemented in the BIND 9 lightweight resolver, and the flag is ignored.
-.TP
+.TP 3n
\fBAI_DEFAULT\fR
This default sets the
\fBAI_V4MAPPED\fR
@@ -145,16 +150,16 @@ to an appropriate error code and the function returns a
\fBNULL\fR
pointer. The error codes and their meanings are defined in
\fI<lwres/netdb.h>\fR:
-.TP
+.TP 3n
\fBHOST_NOT_FOUND\fR
No such host is known.
-.TP
+.TP 3n
\fBNO_ADDRESS\fR
The server recognised the request and the name but no address is available. Another type of request to the name server for the domain might return an answer.
-.TP
+.TP 3n
\fBTRY_AGAIN\fR
A temporary and possibly transient error occurred, such as a failure of a server to respond. The request may succeed if retried.
-.TP
+.TP 3n
\fBNO_RECOVERY\fR
An unexpected failure occurred, and retrying the request is pointless.
.PP
@@ -168,3 +173,5 @@ translates these error codes to suitable error messages.
\fBlwres_getaddrinfo\fR(3),
\fBlwres_getnameinfo\fR(3),
\fBlwres_hstrerror\fR(3).
+.SH "COPYRIGHT"
+Copyright \(co 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_getipnode.html b/usr.sbin/bind/lib/lwres/man/lwres_getipnode.html
index 62dc994bcc1..d38c835eb0d 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_getipnode.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_getipnode.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_getipnode.html,v 1.7.2.1.4.9 2005/10/13 02:33:56 marka Exp $ -->
+<!-- $ISC: lwres_getipnode.html,v 1.7.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_getipnode</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent &#8212; lightweight resolver nodename / address translation API</p>
@@ -52,6 +52,11 @@ struct hostent *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -77,22 +82,35 @@ struct hostent *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_freehostent</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525896"></a><h2>DESCRIPTION</h2>
+<a name="id2549461"></a><h2>DESCRIPTION</h2>
<p>
These functions perform thread safe, protocol independent
nodename-to-address and address-to-nodename
@@ -233,7 +251,7 @@ structure itself.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526131"></a><h2>RETURN VALUES</h2>
+<a name="id2549832"></a><h2>RETURN VALUES</h2>
<p>
If an error occurs,
<code class="function">lwres_getipnodebyname()</code>
@@ -279,7 +297,7 @@ translates these error codes to suitable error messages.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526290"></a><h2>SEE ALSO</h2>
+<a name="id2549923"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">RFC2553</span></span>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_getnameinfo.html b/usr.sbin/bind/lib/lwres/man/lwres_getnameinfo.html
index 1a75c600182..32cfef61d5f 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_getnameinfo.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_getnameinfo.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_getnameinfo.html,v 1.5.2.1.4.9 2005/10/13 02:33:56 marka Exp $ -->
+<!-- $ISC: lwres_getnameinfo.html,v 1.5.2.1.4.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_getnameinfo</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_getnameinfo &#8212; lightweight resolver socket address structure to hostname and service name</p>
@@ -67,6 +67,11 @@ int
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -74,7 +79,7 @@ int
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525862"></a><h2>DESCRIPTION</h2>
+<a name="id2549427"></a><h2>DESCRIPTION</h2>
<p> This function is equivalent to the <span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span> function defined in RFC2133.
<code class="function">lwres_getnameinfo()</code> returns the hostname for the
<span class="type">struct sockaddr</span> <em class="parameter"><code>sa</code></em> which is
@@ -125,14 +130,14 @@ TCP.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525988"></a><h2>RETURN VALUES</h2>
+<a name="id2549553"></a><h2>RETURN VALUES</h2>
<p>
<code class="function">lwres_getnameinfo()</code>
returns 0 on success or a non-zero error code if an error occurs.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526001"></a><h2>SEE ALSO</h2>
+<a name="id2549634"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">RFC2133</span></span>,
<span class="citerefentry"><span class="refentrytitle">getservbyport</span>(3)</span>,
@@ -143,7 +148,7 @@ returns 0 on success or a non-zero error code if an error occurs.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526059"></a><h2>BUGS</h2>
+<a name="id2549692"></a><h2>BUGS</h2>
<p>
RFC2133 fails to define what the nonzero return values of
<span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span>
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_getrrsetbyname.html b/usr.sbin/bind/lib/lwres/man/lwres_getrrsetbyname.html
index 2ce86890e22..75b4f5b5ede 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_getrrsetbyname.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_getrrsetbyname.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_getrrsetbyname.html,v 1.5.2.1.4.9 2005/10/13 02:33:57 marka Exp $ -->
+<!-- $ISC: lwres_getrrsetbyname.html,v 1.5.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_getrrsetbyname</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_getrrsetbyname, lwres_freerrset &#8212; retrieve DNS records</p>
@@ -57,18 +57,31 @@ int
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
-<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
+<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
+<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_freerrset</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
-</tr></table>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
+<td>
+<code>)</code>;</td>
+</tr>
+</table>
</div>
<p>
The following structures are used:
@@ -95,7 +108,7 @@ struct rrsetinfo {
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525878"></a><h2>DESCRIPTION</h2>
+<a name="id2549443"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_getrrsetbyname()</code>
gets a set of resource records associated with a
@@ -172,7 +185,7 @@ created by a call to
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526058"></a><h2>RETURN VALUES</h2>
+<a name="id2549623"></a><h2>RETURN VALUES</h2>
<p>
<code class="function">lwres_getrrsetbyname()</code>
returns zero on success, and one of the following error
@@ -208,7 +221,7 @@ other failure
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526132"></a><h2>SEE ALSO</h2>
+<a name="id2549697"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.
</p>
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_gnba.html b/usr.sbin/bind/lib/lwres/man/lwres_gnba.html
index ee070eb4e90..3d898597e4c 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_gnba.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_gnba.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_gnba.html,v 1.6.2.1.4.9 2005/10/13 02:33:57 marka Exp $ -->
+<!-- $ISC: lwres_gnba.html,v 1.6.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_gnba</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free &#8212; lightweight resolver getnamebyaddress message handling</p>
@@ -39,25 +39,31 @@
lwres_result_t
<b class="fsfunc">lwres_gnbarequest_render</b>
(</code></td>
-<td>lwres_context_t * </td>
+<td> </td>
<td>
<var class="pdparam">ctx</var>, </td>
</tr>
<tr>
<td> </td>
-<td>lwres_gnbarequest_t * </td>
+<td> </td>
+<td>
+<var class="pdparam">ctx</var>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<var class="pdparam">req</var>, </td>
</tr>
<tr>
<td> </td>
-<td>lwres_lwpacket_t * </td>
+<td> </td>
<td>
<var class="pdparam">pkt</var>, </td>
</tr>
<tr>
<td> </td>
-<td>lwres_buffer_t * </td>
+<td> </td>
<td>
<var class="pdparam">b</var><code>)</code>;</td>
</tr>
@@ -84,6 +90,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -109,6 +120,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -134,6 +150,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -150,6 +171,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -165,6 +191,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -172,7 +203,7 @@ void
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525975"></a><h2>DESCRIPTION</h2>
+<a name="id2549540"></a><h2>DESCRIPTION</h2>
<p>
These are low-level routines for creating and parsing
lightweight resolver address-to-name lookup request and
@@ -277,7 +308,7 @@ structures is also discarded.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526100"></a><h2>RETURN VALUES</h2>
+<a name="id2549733"></a><h2>RETURN VALUES</h2>
<p>
The getnamebyaddr opcode functions
<code class="function">lwres_gnbarequest_render()</code>,
@@ -315,7 +346,7 @@ indicate that the packet is not a response to an earlier query.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526165"></a><h2>SEE ALSO</h2>
+<a name="id2549866"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3)</span>.
</p>
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_hstrerror.html b/usr.sbin/bind/lib/lwres/man/lwres_hstrerror.html
index 8b0b0dc5ab4..6e7c5ba70b2 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_hstrerror.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_hstrerror.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_hstrerror.html,v 1.5.2.1.4.9 2005/10/13 02:33:57 marka Exp $ -->
+<!-- $ISC: lwres_hstrerror.html,v 1.5.2.1.4.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_hstrerror</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_herror, lwres_hstrerror &#8212; lightweight resolver error message generation</p>
@@ -40,7 +40,7 @@ const char *
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525859"></a><h2>DESCRIPTION</h2>
+<a name="id2549424"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_herror()</code> prints the string
<em class="parameter"><code>s</code></em> on <span class="type">stderr</span> followed by the string
@@ -79,7 +79,7 @@ the error codes and messages are as follows:
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525971"></a><h2>RETURN VALUES</h2>
+<a name="id2549536"></a><h2>RETURN VALUES</h2>
<p>
The string <span class="errorname">Unknown resolver error</span> is returned by
<code class="function">lwres_hstrerror()</code>
@@ -89,7 +89,7 @@ is not a valid error code.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525990"></a><h2>SEE ALSO</h2>
+<a name="id2549555"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">herror</span>(3)</span>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_inetntop.html b/usr.sbin/bind/lib/lwres/man/lwres_inetntop.html
index fd4ed77cd3b..e4dda3765e3 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_inetntop.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_inetntop.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_inetntop.html,v 1.5.2.1.4.9 2005/10/13 02:33:57 marka Exp $ -->
+<!-- $ISC: lwres_inetntop.html,v 1.5.2.1.4.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_inetntop</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_net_ntop &#8212; lightweight resolver IP address presentation</p>
@@ -52,6 +52,11 @@ const char *
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -59,7 +64,7 @@ const char *
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525854"></a><h2>DESCRIPTION</h2>
+<a name="id2549419"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_net_ntop()</code> converts an IP address of
protocol family <em class="parameter"><code>af</code></em> &#8212; IPv4 or IPv6 &#8212;
@@ -75,7 +80,7 @@ ASCII representation of the address.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525888"></a><h2>RETURN VALUES</h2>
+<a name="id2549452"></a><h2>RETURN VALUES</h2>
<p>
If successful, the function returns <em class="parameter"><code>dst</code></em>:
a pointer to a string containing the presentation format of the
@@ -87,7 +92,7 @@ supported.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2525918"></a><h2>SEE ALSO</h2>
+<a name="id2549483"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">RFC1884</span></span>,
<span class="citerefentry"><span class="refentrytitle">inet_ntop</span>(3)</span>,
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_noop.html b/usr.sbin/bind/lib/lwres/man/lwres_noop.html
index 9bc100d2406..d47af0cb2b5 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_noop.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_noop.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_noop.html,v 1.7.2.1.4.9 2005/10/13 02:33:57 marka Exp $ -->
+<!-- $ISC: lwres_noop.html,v 1.7.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_noop</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free &#8212; lightweight resolver no-op message handling</p>
@@ -53,6 +53,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -78,6 +83,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -103,6 +113,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -128,6 +143,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -143,6 +163,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -158,6 +183,11 @@ void
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -165,7 +195,7 @@ void
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525963"></a><h2>DESCRIPTION</h2>
+<a name="id2549528"></a><h2>DESCRIPTION</h2>
<p>
These are low-level routines for creating and parsing
lightweight resolver no-op request and response messages.
@@ -246,7 +276,7 @@ structures referenced via <em class="parameter"><code>structp</code></em>.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526096"></a><h2>RETURN VALUES</h2>
+<a name="id2549797"></a><h2>RETURN VALUES</h2>
<p>
The no-op opcode functions
<code class="function">lwres_nooprequest_render()</code>,
@@ -285,7 +315,7 @@ indicate that the packet is not a response to an earlier query.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526160"></a><h2>SEE ALSO</h2>
+<a name="id2549861"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3
)</span>
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_packet.html b/usr.sbin/bind/lib/lwres/man/lwres_packet.html
index 8d237245841..1c650db7469 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_packet.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_packet.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_packet.html,v 1.8.2.1.4.9 2005/10/13 02:33:57 marka Exp $ -->
+<!-- $ISC: lwres_packet.html,v 1.8.2.1.4.12 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_packet</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_lwpacket_renderheader, lwres_lwpacket_parseheader &#8212; lightweight resolver packet handling functions</p>
@@ -42,6 +42,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -57,6 +62,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -64,7 +74,7 @@ lwres_result_t
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525865"></a><h2>DESCRIPTION</h2>
+<a name="id2549430"></a><h2>DESCRIPTION</h2>
<p>
These functions rely on a
<span class="type">struct lwres_lwpacket</span>
@@ -202,7 +212,7 @@ buffer <em class="parameter"><code>*b</code></em> to resolver packet
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526068"></a><h2>RETURN VALUES</h2>
+<a name="id2549769"></a><h2>RETURN VALUES</h2>
<p> Successful calls to
<code class="function">lwres_lwpacket_renderheader()</code> and
<code class="function">lwres_lwpacket_parseheader()</code> return
diff --git a/usr.sbin/bind/lib/lwres/man/lwres_resutil.html b/usr.sbin/bind/lib/lwres/man/lwres_resutil.html
index 9800b6ccfba..a4cd0a7c57d 100644
--- a/usr.sbin/bind/lib/lwres/man/lwres_resutil.html
+++ b/usr.sbin/bind/lib/lwres/man/lwres_resutil.html
@@ -14,15 +14,15 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $ISC: lwres_resutil.html,v 1.8.2.1.4.9 2005/10/13 02:33:58 marka Exp $ -->
+<!-- $ISC: lwres_resutil.html,v 1.8.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_resutil</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
-<a name="id2463721"></a><div class="titlepage"></div>
+<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr &#8212; lightweight resolver utility functions</p>
@@ -47,6 +47,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -62,6 +67,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -87,6 +97,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -117,6 +132,11 @@ lwres_result_t
<tr>
<td> </td>
<td> </td>
+<td>, </td>
+</tr>
+<tr>
+<td> </td>
+<td> </td>
<td>
<code>)</code>;</td>
</tr>
@@ -124,7 +144,7 @@ lwres_result_t
</div>
</div>
<div class="refsect1" lang="en">
-<a name="id2525921"></a><h2>DESCRIPTION</h2>
+<a name="id2549485"></a><h2>DESCRIPTION</h2>
<p>
<code class="function">lwres_string_parse()</code> retrieves a DNS-encoded
string starting the current pointer of lightweight resolver buffer
@@ -200,7 +220,7 @@ is made available through <em class="parameter"><code>*structp</code></em>.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526060"></a><h2>RETURN VALUES</h2>
+<a name="id2549693"></a><h2>RETURN VALUES</h2>
<p>
Successful calls to
<code class="function">lwres_string_parse()</code>
@@ -244,7 +264,7 @@ small.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2526130"></a><h2>SEE ALSO</h2>
+<a name="id2549763"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres_buffer</span>(3)</span>,