svn commit: r184967 - in stable/7: contrib/bind9 contrib/bind9/bin/dig contrib/bind9/bin/named contrib/bind9/bin/rndc contrib/bind9/doc/arm contrib/bind9/lib/bind contrib/bind9/lib/bind9 contrib/bi...

Doug Barton dougb at FreeBSD.org
Fri Nov 14 03:00:36 PST 2008


Author: dougb
Date: Fri Nov 14 11:00:34 2008
New Revision: 184967
URL: http://svn.freebsd.org/changeset/base/184967

Log:
  MFC the BIND 9.4.2-P2 update
  
  Approved by:	re (kib)

Modified:
  stable/7/contrib/bind9/   (props changed)
  stable/7/contrib/bind9/CHANGES
  stable/7/contrib/bind9/COPYRIGHT
  stable/7/contrib/bind9/bin/dig/dighost.c
  stable/7/contrib/bind9/bin/named/client.c
  stable/7/contrib/bind9/bin/named/config.c
  stable/7/contrib/bind9/bin/named/controlconf.c
  stable/7/contrib/bind9/bin/named/interfacemgr.c
  stable/7/contrib/bind9/bin/named/lwresd.c
  stable/7/contrib/bind9/bin/named/named.conf.docbook
  stable/7/contrib/bind9/bin/named/server.c
  stable/7/contrib/bind9/bin/rndc/rndc.c
  stable/7/contrib/bind9/configure.in
  stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml
  stable/7/contrib/bind9/lib/bind/configure.in
  stable/7/contrib/bind9/lib/bind9/check.c
  stable/7/contrib/bind9/lib/dns/api
  stable/7/contrib/bind9/lib/dns/dispatch.c
  stable/7/contrib/bind9/lib/dns/include/dns/dispatch.h
  stable/7/contrib/bind9/lib/dns/request.c
  stable/7/contrib/bind9/lib/dns/resolver.c
  stable/7/contrib/bind9/lib/dns/xfrin.c
  stable/7/contrib/bind9/lib/isc/api
  stable/7/contrib/bind9/lib/isc/include/isc/resource.h
  stable/7/contrib/bind9/lib/isc/include/isc/socket.h
  stable/7/contrib/bind9/lib/isc/include/isc/timer.h
  stable/7/contrib/bind9/lib/isc/timer.c
  stable/7/contrib/bind9/lib/isc/unix/app.c
  stable/7/contrib/bind9/lib/isc/unix/resource.c
  stable/7/contrib/bind9/lib/isc/unix/socket.c
  stable/7/contrib/bind9/lib/isc/unix/socket_p.h
  stable/7/contrib/bind9/lib/isccfg/api
  stable/7/contrib/bind9/lib/isccfg/namedconf.c
  stable/7/contrib/bind9/version
  stable/7/lib/bind/   (props changed)
  stable/7/lib/bind/config.h

Modified: stable/7/contrib/bind9/CHANGES
==============================================================================
--- stable/7/contrib/bind9/CHANGES	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/CHANGES	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,3 +1,47 @@
+	--- 9.4.2-P2 released ---
+
+2406.   [bug]           Some operating systems have FD_SETSIZE set to a
+			low value by default, which can cause resource
+			exhaustion when many simultaneous connections are
+			open.  Linux in particular makes it difficult to
+			increase this value.  To use more sockets with
+			select(), set ISC_SOCKET_FDSETSIZE.  Example:
+			STD_CDEFINES="-DISC_SOCKET_FDSETSIZE=4096" ./configure
+			(This should not be necessary in most cases, and
+			never for an authoritative-only server.) [RT #18328]
+
+2404.	[port]		hpux: files unlimited support.
+
+2403.	[bug]		TSIG context leak. [RT #18341]
+
+2402.	[port]		Support Solaris 2.11 and over. [RT #18362]
+
+2401.	[bug]		Expect to get E[MN]FILE errno internal_accept()
+			(from accept() or fcntl() system calls). [RT #18358]
+
+2399.	[bug]		Abort timeout queries to reduce the number of open
+			UDP sockets. [RT #18367]
+
+2398.	[bug]           Improve file descriptor management.  New,
+			temporary, named.conf option reserved-sockets,
+			default 512. [RT #18344]
+
+2396.	[bug]		Don't set SO_REUSEADDR for randomized ports.
+			[RT #18336]
+
+2395.	[port]		Avoid warning and no effect from "files unlimited"
+			on Linux when running as root. [RT #18335]
+
+2394.	[bug]		Default configuration options set the limit for
+			open files to 'unlimited' as described in the
+			documentation. [RT #18331]
+
+2392.	[bug]		remove 'grep -q' from acl test script, some platforms
+			don't support it. [RT #18253]
+
+2322.	[port]		MacOS: work around the limitation of setrlimit()
+			for RLIMIT_NOFILE. [RT #17526]
+
 	--- 9.4.2-P1 released ---
 
 2375.   [security]      Fully randomize UDP query ports to improve
@@ -33,7 +77,7 @@
 			[RT #17113]
 
 2249.   [bug]           Only set Authentic Data bit if client requested
-                        DNSSEC, per RFC 3655 [RT #17175]
+			DNSSEC, per RFC 3655 [RT #17175]
 
 2248.   [cleanup]       Fix several errors reported by Coverity. [RT #17160]
 

Modified: stable/7/contrib/bind9/COPYRIGHT
==============================================================================
--- stable/7/contrib/bind9/COPYRIGHT	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/COPYRIGHT	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,4 +1,4 @@
-Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
 Copyright (C) 1996-2003  Internet Software Consortium.
 
 Permission to use, copy, modify, and/or distribute this software for any
@@ -13,7 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN
 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 PERFORMANCE OF THIS SOFTWARE.
 
-$Id: COPYRIGHT,v 1.9.18.4 2007/08/28 07:19:54 tbox Exp $
+$Id: COPYRIGHT,v 1.9.18.4.10.1 2008/07/23 07:28:54 tbox Exp $
 
 Portions Copyright (C) 1996-2001  Nominum, Inc.
 

Modified: stable/7/contrib/bind9/bin/dig/dighost.c
==============================================================================
--- stable/7/contrib/bind9/bin/dig/dighost.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/dig/dighost.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.259.18.43 2007/08/28 07:19:55 tbox Exp $ */
+/* $Id: dighost.c,v 1.259.18.43.10.3 2008/07/23 23:16:43 marka Exp $ */
 
 /*! \file
  *  \note
@@ -2217,14 +2217,15 @@ send_tcp_connect(dig_query_t *query) {
 	sockcount++;
 	debug("sockcount=%d", sockcount);
 	if (specified_source)
-		result = isc_socket_bind(query->sock, &bind_address);
+		result = isc_socket_bind(query->sock, &bind_address,
+					 ISC_SOCKET_REUSEADDRESS);
 	else {
 		if ((isc_sockaddr_pf(&query->sockaddr) == AF_INET) &&
 		    have_ipv4)
 			isc_sockaddr_any(&bind_any);
 		else
 			isc_sockaddr_any6(&bind_any);
-		result = isc_socket_bind(query->sock, &bind_any);
+		result = isc_socket_bind(query->sock, &bind_any, 0);
 	}
 	check_result(result, "isc_socket_bind");
 	bringup_timer(query, TCP_TIMEOUT);
@@ -2271,11 +2272,12 @@ send_udp(dig_query_t *query) {
 		sockcount++;
 		debug("sockcount=%d", sockcount);
 		if (specified_source) {
-			result = isc_socket_bind(query->sock, &bind_address);
+			result = isc_socket_bind(query->sock, &bind_address,
+						 ISC_SOCKET_REUSEADDRESS);
 		} else {
 			isc_sockaddr_anyofpf(&bind_any,
 					isc_sockaddr_pf(&query->sockaddr));
-			result = isc_socket_bind(query->sock, &bind_any);
+			result = isc_socket_bind(query->sock, &bind_any, 0);
 		}
 		check_result(result, "isc_socket_bind");
 

Modified: stable/7/contrib/bind9/bin/named/client.c
==============================================================================
--- stable/7/contrib/bind9/bin/named/client.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/named/client.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1999-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: client.c,v 1.219.18.28.10.1 2008/05/22 21:28:04 each Exp $ */
+/* $Id: client.c,v 1.219.18.28.10.2 2008/07/23 07:28:54 tbox Exp $ */
 
 #include <config.h>
 

Modified: stable/7/contrib/bind9/bin/named/config.c
==============================================================================
--- stable/7/contrib/bind9/bin/named/config.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/named/config.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2001-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.c,v 1.47.18.32 2007/09/13 05:04:01 each Exp $ */
+/* $Id: config.c,v 1.47.18.32.10.3 2008/07/23 23:48:17 tbox Exp $ */
 
 /*! \file */
 
@@ -52,7 +52,7 @@ options {\n\
 #ifndef WIN32
 "	coresize default;\n\
 	datasize default;\n\
-	files default;\n\
+	files unlimited;\n\
 	stacksize default;\n"
 #endif
 "	deallocate-on-exit true;\n\
@@ -99,6 +99,7 @@ options {\n\
 	use-ixfr true;\n\
 	edns-udp-size 4096;\n\
 	max-udp-size 4096;\n\
+	reserved-sockets 512;\n\
 \n\
 	/* view */\n\
 	allow-notify {none;};\n\

Modified: stable/7/contrib/bind9/bin/named/controlconf.c
==============================================================================
--- stable/7/contrib/bind9/bin/named/controlconf.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/named/controlconf.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2001-2003  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: controlconf.c,v 1.40.18.10 2006/12/07 04:53:02 marka Exp $ */
+/* $Id: controlconf.c,v 1.40.18.10.40.3 2008/07/23 23:16:43 marka Exp $ */
 
 /*! \file */
 
@@ -1151,8 +1151,8 @@ add_listener(ns_controls_t *cp, controll
 					   type, &listener->sock);
 
 	if (result == ISC_R_SUCCESS)
-		result = isc_socket_bind(listener->sock,
-					 &listener->address);
+		result = isc_socket_bind(listener->sock, &listener->address,
+					 ISC_SOCKET_REUSEADDRESS);
 
 	if (result == ISC_R_SUCCESS && type == isc_sockettype_unix) {
 		listener->perm = cfg_obj_asuint32(cfg_tuple_get(control,

Modified: stable/7/contrib/bind9/bin/named/interfacemgr.c
==============================================================================
--- stable/7/contrib/bind9/bin/named/interfacemgr.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/named/interfacemgr.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1999-2002  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: interfacemgr.c,v 1.76.18.8 2006/07/20 01:10:30 marka Exp $ */
+/* $Id: interfacemgr.c,v 1.76.18.8.44.3 2008/07/23 23:16:43 marka Exp $ */
 
 /*! \file */
 
@@ -307,7 +307,8 @@ ns_interface_accepttcp(ns_interface_t *i
 #ifndef ISC_ALLOW_MAPPED
 	isc_socket_ipv6only(ifp->tcpsocket, ISC_TRUE);
 #endif
-	result = isc_socket_bind(ifp->tcpsocket, &ifp->addr);
+	result = isc_socket_bind(ifp->tcpsocket, &ifp->addr,
+				 ISC_SOCKET_REUSEADDRESS);
 	if (result != ISC_R_SUCCESS) {
 		isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR,
 				 "binding TCP socket: %s",

Modified: stable/7/contrib/bind9/bin/named/lwresd.c
==============================================================================
--- stable/7/contrib/bind9/bin/named/lwresd.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/named/lwresd.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000-2003  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwresd.c,v 1.46.18.7 2006/03/02 00:37:21 marka Exp $ */
+/* $Id: lwresd.c,v 1.46.18.7.52.3 2008/07/23 23:16:43 marka Exp $ */
 
 /*! \file 
  * \brief
@@ -576,7 +576,8 @@ listener_bind(ns_lwreslistener_t *listen
 		return (result);
 	}
 
-	result = isc_socket_bind(sock, &listener->address);
+	result = isc_socket_bind(sock, &listener->address,
+				 ISC_SOCKET_REUSEADDRESS);
 	if (result != ISC_R_SUCCESS) {
 		char socktext[ISC_SOCKADDR_FORMATSIZE];
 		isc_sockaddr_format(&listener->address, socktext,

Modified: stable/7/contrib/bind9/bin/named/named.conf.docbook
==============================================================================
--- stable/7/contrib/bind9/bin/named/named.conf.docbook	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/named/named.conf.docbook	Fri Nov 14 11:00:34 2008	(r184967)
@@ -2,7 +2,7 @@
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
 	       [<!ENTITY mdash "&#8212;">]>
 <!--
- - Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  -
  - Permission to use, copy, modify, and/or distribute this software for any
  - purpose with or without fee is hereby granted, provided that the above
@@ -17,7 +17,7 @@
  - PERFORMANCE OF THIS SOFTWARE.
 -->
 
-<!-- $Id: named.conf.docbook,v 1.1.2.29 2007/08/28 07:20:01 tbox Exp $ -->
+<!-- $Id: named.conf.docbook,v 1.1.2.29.12.2 2008/07/23 23:48:17 tbox Exp $ -->
 <refentry>
   <refentryinfo>
     <date>Aug 13, 2004</date>
@@ -40,6 +40,7 @@
       <year>2005</year>
       <year>2006</year>
       <year>2007</year>
+      <year>2008</year>
       <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
     </copyright>
   </docinfo>
@@ -201,6 +202,7 @@ options {
 	port <replaceable>integer</replaceable>;
 	querylog <replaceable>boolean</replaceable>;
 	recursing-file <replaceable>quoted_string</replaceable>;
+	reserved-sockets <replaceable>integer</replaceable>;
 	random-device <replaceable>quoted_string</replaceable>;
 	recursive-clients <replaceable>integer</replaceable>;
 	serial-query-rate <replaceable>integer</replaceable>;

Modified: stable/7/contrib/bind9/bin/named/server.c
==============================================================================
--- stable/7/contrib/bind9/bin/named/server.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/named/server.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1999-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.419.18.57.10.1 2008/05/22 21:28:04 each Exp $ */
+/* $Id: server.c,v 1.419.18.57.10.3 2008/07/23 12:04:32 marka Exp $ */
 
 /*! \file */
 
@@ -2696,27 +2696,29 @@ static isc_result_t
 load_configuration(const char *filename, ns_server_t *server,
 		   isc_boolean_t first_time)
 {
-	isc_result_t result;
-	isc_interval_t interval;
-	cfg_parser_t *parser = NULL;
+	cfg_aclconfctx_t aclconfctx;
 	cfg_obj_t *config;
-	const cfg_obj_t *options;
-	const cfg_obj_t *views;
+	cfg_parser_t *parser = NULL;
+	const cfg_listelt_t *element;
+	const cfg_obj_t *builtin_views;
+	const cfg_obj_t *maps[3];
 	const cfg_obj_t *obj;
+	const cfg_obj_t *options;
 	const cfg_obj_t *v4ports, *v6ports;
-	const cfg_obj_t *maps[3];
-	const cfg_obj_t *builtin_views;
-	const cfg_listelt_t *element;
+	const cfg_obj_t *views;
 	dns_view_t *view = NULL;
 	dns_view_t *view_next;
-	dns_viewlist_t viewlist;
 	dns_viewlist_t tmpviewlist;
-	cfg_aclconfctx_t aclconfctx;
-	isc_uint32_t interface_interval;
-	isc_uint32_t heartbeat_interval;
-	isc_uint32_t udpsize;
+	dns_viewlist_t viewlist;
 	in_port_t listen_port;
 	int i;
+	isc_interval_t interval;
+	isc_resourcevalue_t files;
+	isc_result_t result;
+	isc_uint32_t heartbeat_interval;
+	isc_uint32_t interface_interval;
+	isc_uint32_t reserved;
+	isc_uint32_t udpsize;
 
 	cfg_aclconfctx_init(&aclconfctx);
 	ISC_LIST_INIT(viewlist);
@@ -2797,6 +2799,43 @@ load_configuration(const char *filename,
 	set_limits(maps);
 
 	/*
+	 * Sanity check on "files" limit.
+	 */
+	result = isc_resource_curlimit(isc_resource_openfiles, &files);
+	if (result == ISC_R_SUCCESS && files < FD_SETSIZE) {
+		isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
+			      NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
+			      "the 'files' limit (%" ISC_PRINT_QUADFORMAT "u) "
+			      "is less than FD_SETSIZE (%d), increase "
+			      "'files' in named.conf or recompile with a "
+			      "smaller FD_SETSIZE.", files, FD_SETSIZE);
+		if (files > FD_SETSIZE)
+			files = FD_SETSIZE;
+	} else
+		files = FD_SETSIZE;
+
+	/*
+	 * Set the number of socket reserved for TCP, stdio etc.
+	 */
+	obj = NULL;
+	result = ns_config_get(maps, "reserved-sockets", &obj);
+	INSIST(result == ISC_R_SUCCESS);
+	reserved = cfg_obj_asuint32(obj);
+	if (files < 128U)			/* Prevent underflow. */
+		reserved = 0;
+	else if (reserved > files - 128U)	/* Mimimum UDP space. */
+		reserved = files - 128;
+	if (reserved < 128U)			/* Mimimum TCP/stdio space. */
+		reserved = 128;
+	if (reserved + 128U > files) {
+		isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
+                              NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
+			      "less than 128 UDP sockets available after "
+			      "applying 'reserved-sockets' and 'files'");
+	}
+	isc__socketmgr_setreserved(ns_g_socketmgr, reserved);
+	
+	/*
 	 * Configure various server options.
 	 */
 	configure_server_quota(maps, "transfers-out", &server->xfroutquota);

Modified: stable/7/contrib/bind9/bin/rndc/rndc.c
==============================================================================
--- stable/7/contrib/bind9/bin/rndc/rndc.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/bin/rndc/rndc.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000-2003  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rndc.c,v 1.96.18.17 2006/08/04 03:03:41 marka Exp $ */
+/* $Id: rndc.c,v 1.96.18.17.42.3 2008/07/23 23:16:43 marka Exp $ */
 
 /*! \file */
 
@@ -400,10 +400,10 @@ rndc_startconnect(isc_sockaddr_t *addr, 
 	DO("create socket", isc_socket_create(socketmgr, pf, type, &sock));
 	switch (isc_sockaddr_pf(addr)) {
 	case AF_INET:
-		DO("bind socket", isc_socket_bind(sock, &local4));
+		DO("bind socket", isc_socket_bind(sock, &local4, 0));
 		break;
 	case AF_INET6:
-		DO("bind socket", isc_socket_bind(sock, &local6));
+		DO("bind socket", isc_socket_bind(sock, &local6, 0));
 		break;
 	default:
 		break;

Modified: stable/7/contrib/bind9/configure.in
==============================================================================
--- stable/7/contrib/bind9/configure.in	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/configure.in	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
 # Copyright (C) 1998-2003  Internet Software Consortium.
 #
 # Permission to use, copy, modify, and/or distribute this software for any
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
 AC_DIVERT_POP()dnl
 
-AC_REVISION($Revision: 1.355.18.71 $)
+AC_REVISION($Revision: 1.355.18.71.8.2 $)
 
 AC_INIT(lib/dns/name.c)
 AC_PREREQ(2.59)
@@ -1839,7 +1839,7 @@ case "$host" in
 	[*-solaris2.[89]])
 		hack_shutup_pthreadonceinit=yes
 		;;
-	*-solaris2.10)
+	*-solaris2.1[0-9])
 		hack_shutup_pthreadonceinit=yes
 		;;
 esac

Modified: stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml
==============================================================================
--- stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/doc/arm/Bv9ARM-book.xml	Fri Nov 14 11:00:34 2008	(r184967)
@@ -2,7 +2,7 @@
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
 	       [<!ENTITY mdash "&#8212;">]>
 <!--
- - Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  - Copyright (C) 2000-2003  Internet Software Consortium.
  -
  - Permission to use, copy, modify, and/or distribute this software for any
@@ -18,7 +18,7 @@
  - PERFORMANCE OF THIS SOFTWARE.
 -->
 
-<!-- File: $Id: Bv9ARM-book.xml,v 1.241.18.82.8.1 2008/05/22 21:28:04 each Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.241.18.82.8.3 2008/07/23 12:04:32 marka Exp $ -->
 <book xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>BIND 9 Administrator Reference Manual</title>
 
@@ -28,6 +28,7 @@
       <year>2005</year>
       <year>2006</year>
       <year>2007</year>
+      <year>2008</year>
       <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
     </copyright>
     <copyright>
@@ -4441,6 +4442,7 @@ category notify { null; };
     <optional> max-transfer-idle-in <replaceable>number</replaceable>; </optional>
     <optional> max-transfer-idle-out <replaceable>number</replaceable>; </optional>
     <optional> tcp-clients <replaceable>number</replaceable>; </optional>
+    <optional> reserved-sockets <replaceable>number</replaceable>; </optional>
     <optional> recursive-clients <replaceable>number</replaceable>; </optional>
     <optional> serial-query-rate <replaceable>number</replaceable>; </optional>
     <optional> serial-queries <replaceable>number</replaceable>; </optional>
@@ -6606,6 +6608,23 @@ query-source-v6 address * port *;
             </varlistentry>
 
             <varlistentry>
+              <term><command>reserved-sockets</command></term>
+              <listitem>
+                <para>
+		  The number of file descriptors reserved for TCP, stdio,
+		  etc.  This needs to be big enough to cover the number of
+		  interfaces named listens on, tcp-clients as well as
+		  to provide room for outgoing TCP queries and incoming zone
+		  transfers.  The default is <literal>512</literal>.
+		  The minimum value is <literal>128</literal> and the
+		  maximum value is <literal>128</literal> less than
+		  'files' or FD_SETSIZE (whichever is smaller).  This
+		  option may be removed in the future.
+                </para>
+              </listitem>
+            </varlistentry>
+
+            <varlistentry>
               <term><command>max-cache-size</command></term>
               <listitem>
                 <para>

Modified: stable/7/contrib/bind9/lib/bind/configure.in
==============================================================================
--- stable/7/contrib/bind9/lib/bind/configure.in	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/bind/configure.in	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
 # Copyright (C) 2001, 2003  Internet Software Consortium.
 #
 # Permission to use, copy, modify, and/or 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.
 
-AC_REVISION($Revision: 1.90.18.34 $)
+AC_REVISION($Revision: 1.90.18.34.10.2 $)
 
 AC_INIT(resolv/herror.c)
 AC_PREREQ(2.13)
@@ -2590,7 +2590,7 @@ case "$host" in
 	*-solaris2.9)
 		hack_shutup_in6addr_init_macros=yes
 		;;
-	*-solaris2.10)
+	*-solaris2.1[0-9])
 		hack_shutup_in6addr_init_macros=yes
 		;;
 esac

Modified: stable/7/contrib/bind9/lib/bind9/check.c
==============================================================================
--- stable/7/contrib/bind9/lib/bind9/check.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/bind9/check.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1015,10 +1015,10 @@ check_zoneconf(const cfg_obj_t *zconfig,
 	isc_buffer_add(&b, strlen(zname));
 	tresult = dns_name_fromtext(dns_fixedname_name(&fixedname), &b,
 				   dns_rootname, ISC_TRUE, NULL);
-	if (tresult != ISC_R_SUCCESS) {
+	if (result != ISC_R_SUCCESS) {
 		cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR,
 			    "zone '%s': is not a valid name", zname);
-		result = ISC_R_FAILURE;
+		tresult = ISC_R_FAILURE;
 	} else {
 		char namebuf[DNS_NAME_FORMATSIZE];
 

Modified: stable/7/contrib/bind9/lib/dns/api
==============================================================================
--- stable/7/contrib/bind9/lib/dns/api	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/dns/api	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,3 +1,3 @@
 LIBINTERFACE = 35
-LIBREVISION = 0
+LIBREVISION = 1
 LIBAGE = 0

Modified: stable/7/contrib/bind9/lib/dns/dispatch.c
==============================================================================
--- stable/7/contrib/bind9/lib/dns/dispatch.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/dns/dispatch.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1999-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dispatch.c,v 1.116.18.19.12.1 2008/05/22 21:28:06 each Exp $ */
+/* $Id: dispatch.c,v 1.116.18.19.12.5 2008/07/23 23:16:43 marka Exp $ */
 
 /*! \file */
 
@@ -276,7 +276,26 @@ request_log(dns_dispatch_t *disp, dns_di
 }
 
 /*
- * ARC4 random number generator obtained from OpenBSD
+ * ARC4 random number generator derived from OpenBSD.
+ * Only dispatch_arc4random() and dispatch_arc4uniformrandom() are expected
+ * to be called from general dispatch routines; the rest of them are subroutines
+ * for these two.
+ *
+ * The original copyright follows:
+ * Copyright (c) 1996, David Mazieres <dm at uun.org>
+ * Copyright (c) 2008, Damien Miller <djm at openbsd.org>
+ *
+ * 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 THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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.
  */
 static void
 dispatch_arc4init(arc4ctx_t *actx) {
@@ -1172,7 +1191,7 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) {
 
 static isc_result_t
 create_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local,
-	      isc_socket_t **sockp)
+	      unsigned int options, isc_socket_t **sockp)
 {
 	isc_socket_t *sock;
 	isc_result_t result;
@@ -1186,7 +1205,7 @@ create_socket(isc_socketmgr_t *mgr, isc_
 #ifndef ISC_ALLOW_MAPPED
 	isc_socket_ipv6only(sock, ISC_TRUE);
 #endif
-	result = isc_socket_bind(sock, local);
+	result = isc_socket_bind(sock, local, options);
 	if (result != ISC_R_SUCCESS) {
 		isc_socket_detach(&sock);
 		return (result);
@@ -1917,7 +1936,7 @@ dispatch_createudp(dns_dispatchmgr_t *mg
 				attributes &= ~DNS_DISPATCHATTR_RANDOMPORT;
 			goto getsocket;
 		}
-		result = create_socket(sockmgr, &localaddr_bound, &sock);
+		result = create_socket(sockmgr, &localaddr_bound, 0, &sock);
 		if (result == ISC_R_ADDRINUSE) {
 			if (++k == 1024)
 				attributes &= ~DNS_DISPATCHATTR_RANDOMPORT;
@@ -1925,7 +1944,8 @@ dispatch_createudp(dns_dispatchmgr_t *mg
 		}
 		localport = prt;
 	} else
-		result = create_socket(sockmgr, localaddr, &sock);
+		result = create_socket(sockmgr, localaddr,
+				       ISC_SOCKET_REUSEADDRESS, &sock);
 	if (result != ISC_R_SUCCESS)
 		goto deallocate_dispatch;
 	if ((attributes & DNS_DISPATCHATTR_RANDOMPORT) == 0 &&

Modified: stable/7/contrib/bind9/lib/dns/include/dns/dispatch.h
==============================================================================
--- stable/7/contrib/bind9/lib/dns/include/dns/dispatch.h	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/dns/include/dns/dispatch.h	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1999-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dispatch.h,v 1.48.18.5.12.1 2008/05/22 21:28:06 each Exp $ */
+/* $Id: dispatch.h,v 1.48.18.5.12.2 2008/07/23 07:28:56 tbox Exp $ */
 
 #ifndef DNS_DISPATCH_H
 #define DNS_DISPATCH_H 1

Modified: stable/7/contrib/bind9/lib/dns/request.c
==============================================================================
--- stable/7/contrib/bind9/lib/dns/request.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/dns/request.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000-2002  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: request.c,v 1.72.18.5 2006/08/21 00:40:53 marka Exp $ */
+/* $Id: request.c,v 1.72.18.5.42.2 2008/07/23 07:28:56 tbox Exp $ */
 
 /*! \file */
 
@@ -518,11 +518,11 @@ create_tcp_dispatch(dns_requestmgr_t *re
 	if (srcaddr == NULL) {
 		isc_sockaddr_anyofpf(&bind_any,
 				     isc_sockaddr_pf(destaddr));
-		result = isc_socket_bind(socket, &bind_any);
+		result = isc_socket_bind(socket, &bind_any, 0);
 	} else {
 		src = *srcaddr;
 		isc_sockaddr_setport(&src, 0);
-		result = isc_socket_bind(socket, &src);
+		result = isc_socket_bind(socket, &src, 0);
 	}
 	if (result != ISC_R_SUCCESS)
 		goto cleanup;

Modified: stable/7/contrib/bind9/lib/dns/resolver.c
==============================================================================
--- stable/7/contrib/bind9/lib/dns/resolver.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/dns/resolver.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1999-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.284.18.66.8.1 2008/05/22 21:28:06 each Exp $ */
+/* $Id: resolver.c,v 1.284.18.66.8.4 2008/07/24 05:00:48 jinmei Exp $ */
 
 /*! \file */
 
@@ -1123,7 +1123,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr
 			goto cleanup_query;
 
 #ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
-		result = isc_socket_bind(query->tcpsocket, &addr);
+		result = isc_socket_bind(query->tcpsocket, &addr, 0);
 		if (result != ISC_R_SUCCESS)
 			goto cleanup_socket;
 #endif
@@ -2689,6 +2689,8 @@ fctx_destroy(fetchctx_t *fctx) {
 static void
 fctx_timeout(isc_task_t *task, isc_event_t *event) {
 	fetchctx_t *fctx = event->ev_arg;
+	isc_timerevent_t *tevent = (isc_timerevent_t *)event;
+	resquery_t *query;
 
 	REQUIRE(VALID_FCTX(fctx));
 
@@ -2704,8 +2706,18 @@ fctx_timeout(isc_task_t *task, isc_event
 		fctx->timeouts++;
 		/*
 		 * We could cancel the running queries here, or we could let
-		 * them keep going.  Right now we choose the latter...
-		 */
+		 * them keep going.  Since we normally use separate sockets for
+		 * different queries, we adopt the former approach to reduce
+		 * the number of open sockets: cancel the oldest query if it
+		 * expired after the query had started (this is usually the
+		 * case but is not always so, depending on the task schedule
+		 * timing).
+		 */
+		query = ISC_LIST_HEAD(fctx->queries);
+		if (query != NULL &&
+		    isc_time_compare(&tevent->due, &query->start) >= 0) {
+			fctx_cancelquery(&query, NULL, NULL, ISC_TRUE);
+		}
 		fctx->attributes &= ~FCTX_ATTR_ADDRWAIT;
 		/*
 		 * Our timer has triggered.  Reestablish the fctx lifetime

Modified: stable/7/contrib/bind9/lib/dns/xfrin.c
==============================================================================
--- stable/7/contrib/bind9/lib/dns/xfrin.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/dns/xfrin.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1999-2003  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: xfrin.c,v 1.135.18.16 2007/10/31 01:59:47 marka Exp $ */
+/* $Id: xfrin.c,v 1.135.18.16.10.3 2008/07/23 23:16:43 marka Exp $ */
 
 /*! \file */
 
@@ -862,7 +862,8 @@ xfrin_start(dns_xfrin_ctx_t *xfr) {
 				isc_sockettype_tcp,
 				&xfr->socket));
 #ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
-	CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr));
+	CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr,
+			      ISC_SOCKET_REUSEADDRESS));
 #endif
 	CHECK(isc_socket_connect(xfr->socket, &xfr->masteraddr, xfr->task,
 				 xfrin_connect_done, xfr));

Modified: stable/7/contrib/bind9/lib/isc/api
==============================================================================
--- stable/7/contrib/bind9/lib/isc/api	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/isc/api	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,3 +1,3 @@
-LIBINTERFACE = 32
-LIBREVISION = 5
+LIBINTERFACE = 35
+LIBREVISION = 0
 LIBAGE = 0

Modified: stable/7/contrib/bind9/lib/isc/include/isc/resource.h
==============================================================================
--- stable/7/contrib/bind9/lib/isc/include/isc/resource.h	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/isc/include/isc/resource.h	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004, 2005  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 2000, 2001  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resource.h,v 1.5.18.2 2005/04/29 00:17:02 marka Exp $ */
+/* $Id: resource.h,v 1.5.18.2.52.2 2008/07/23 23:48:17 tbox Exp $ */
 
 #ifndef ISC_RESOURCE_H
 #define ISC_RESOURCE_H 1
@@ -81,6 +81,19 @@ isc_resource_getlimit(isc_resource_t res
  *\li	#ISC_R_NOTIMPLEMENTED	'resource' is not a type known by the OS.
  */
 
+isc_result_t
+isc_resource_curlimit(isc_resource_t resource, isc_resourcevalue_t *value);
+/*
+ * Get the current limit on a resource.
+ *
+ * Requires:
+ *	'resource' is a valid member of the isc_resource_t enumeration.
+ *
+ * Returns:
+ *	ISC_R_SUCCESS		Success.
+ *	ISC_R_NOTIMPLEMENTED	'resource' is not a type known by the OS.
+ */
+
 ISC_LANG_ENDDECLS
 
 #endif /* ISC_RESOURCE_H */

Modified: stable/7/contrib/bind9/lib/isc/include/isc/socket.h
==============================================================================
--- stable/7/contrib/bind9/lib/isc/include/isc/socket.h	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/isc/include/isc/socket.h	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004-2006  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2006, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1998-2002  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.h,v 1.57.18.6 2006/06/07 00:29:45 marka Exp $ */
+/* $Id: socket.h,v 1.57.18.6.46.4 2008/07/23 23:16:43 marka Exp $ */
 
 #ifndef ISC_SOCKET_H
 #define ISC_SOCKET_H 1
@@ -77,6 +77,12 @@ ISC_LANG_BEGINDECLS
  */
 #define ISC_SOCKET_MAXSCATTERGATHER	8
 
+/*%
+ * In isc_socket_bind() set socket option SO_REUSEADDR prior to calling
+ * bind() if a non zero port is specified (AF_INET and AF_INET6).
+ */
+#define ISC_SOCKET_REUSEADDRESS		0x01U
+
 /***
  *** Types
  ***/
@@ -312,7 +318,8 @@ isc_socket_detach(isc_socket_t **socketp
  */
 
 isc_result_t
-isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp);
+isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp,
+	        unsigned int options);
 /*%<
  * Bind 'socket' to '*addressp'.
  *
@@ -747,6 +754,12 @@ isc_socket_permunix(isc_sockaddr_t *sock
  * \li	#ISC_R_FAILURE
  */
 
+void
+isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t);
+/*%<
+ * Temporary.  For use by named only.
+ */
+
 ISC_LANG_ENDDECLS
 
 #endif /* ISC_SOCKET_H */

Modified: stable/7/contrib/bind9/lib/isc/include/isc/timer.h
==============================================================================
--- stable/7/contrib/bind9/lib/isc/include/isc/timer.h	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/isc/include/isc/timer.h	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,8 +1,8 @@
 /*
- * Copyright (C) 2004, 2005  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1998-2002  Internet Software Consortium.
  *
- * Permission to use, copy, modify, and distribute this software for any
+ * Permission to use, copy, modify, and/or 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.
  *
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: timer.h,v 1.31.18.3 2005/10/26 06:50:50 marka Exp $ */
+/* $Id: timer.h,v 1.31.18.3.52.2 2008/07/24 23:48:09 tbox Exp $ */
 
 #ifndef ISC_TIMER_H
 #define ISC_TIMER_H 1
@@ -76,6 +76,7 @@
 #include <isc/event.h>
 #include <isc/eventclass.h>
 #include <isc/lang.h>
+#include <isc/time.h>
 
 ISC_LANG_BEGINDECLS
 
@@ -93,6 +94,7 @@ typedef enum {
 
 typedef struct isc_timerevent {
 	struct isc_event	common;
+	isc_time_t		due;
 } isc_timerevent_t;
 
 #define ISC_TIMEREVENT_FIRSTEVENT	(ISC_EVENTCLASS_TIMER + 0)

Modified: stable/7/contrib/bind9/lib/isc/timer.c
==============================================================================
--- stable/7/contrib/bind9/lib/isc/timer.c	Fri Nov 14 10:59:36 2008	(r184966)
+++ stable/7/contrib/bind9/lib/isc/timer.c	Fri Nov 14 11:00:34 2008	(r184967)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2008  Internet Systems Consortium, Inc. ("ISC")
  * Copyright (C) 1998-2002  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: timer.c,v 1.73.18.7 2007/10/24 23:46:26 tbox Exp $ */
+/* $Id: timer.c,v 1.73.18.7.10.3 2008/07/29 18:35:53 jinmei Exp $ */
 
 /*! \file */
 
@@ -577,7 +577,7 @@ isc_timer_detach(isc_timer_t **timerp) {
 static void
 dispatch(isc_timermgr_t *manager, isc_time_t *now) {
 	isc_boolean_t done = ISC_FALSE, post_event, need_schedule;
-	isc_event_t *event;
+	isc_timerevent_t *event;
 	isc_eventtype_t type = 0;
 	isc_timer_t *timer;
 	isc_result_t result;
@@ -650,16 +650,18 @@ dispatch(isc_timermgr_t *manager, isc_ti
 				/*
 				 * XXX We could preallocate this event.
 				 */
-				event = isc_event_allocate(manager->mctx,
+				event = (isc_timerevent_t *)isc_event_allocate(manager->mctx,
 							   timer,
 							   type,
 							   timer->action,
 							   timer->arg,
 							   sizeof(*event));
 
-				if (event != NULL)
-					isc_task_send(timer->task, &event);
-				else
+				if (event != NULL) {
+					event->due = timer->due;
+					isc_task_send(timer->task,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-stable-7 mailing list