]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2425. [bug] named didn't detect unavailable query source addresses
authorTatuya JINMEI 神明達哉 <jinmei@isc.org>
Tue, 26 Aug 2008 02:08:04 +0000 (02:08 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Tue, 26 Aug 2008 02:08:04 +0000 (02:08 +0000)
at load time. [RT #18536]

CHANGES
lib/dns/dispatch.c

diff --git a/CHANGES b/CHANGES
index f2f0706f1923421fcd81d4c50184ba4ed95637c1..a1952df80b89d7a3af47e1dd238295dc34a8447b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2425.  [bug]           named didn't detect unavailable query source addresses
+                       at load time. [RT #18536]
+
 2424.  [port]          configure now probes for a working epoll
                        implementation.  Allow the use of kqueue,
                        epoll and /dev/poll to be selected at compile
index d34eedf713f438c2add7029c8c6d7f9503446464..e8f5fc75ea8043d3abbf36e8aca016d3993216be 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dispatch.c,v 1.101.2.6.2.34 2008/08/15 17:44:37 jinmei Exp $ */
+/* $Id: dispatch.c,v 1.101.2.6.2.35 2008/08/26 02:08:04 jinmei Exp $ */
 
 #include <config.h>
 
@@ -2631,6 +2631,23 @@ dispatch_createudp(dns_dispatchmgr_t *mgr, isc_socketmgr_t *sockmgr,
                                       0xffffU);
                if (result != ISC_R_SUCCESS)
                        goto deallocate_dispatch;
+       } else {
+               isc_sockaddr_t sa_any;
+
+               /*
+                * For dispatches using exclusive sockets with a specific
+                * source address, we only check if the specified address is
+                * available on the system.  Query sockets will be created later
+                * on demand.
+                */
+               isc_sockaddr_anyofpf(&sa_any, isc_sockaddr_pf(localaddr));
+               if (!isc_sockaddr_eqaddr(&sa_any, localaddr)) {
+                       result = open_socket(sockmgr, localaddr, 0, &sock);
+                       if (sock != NULL)
+                               isc_socket_detach(&sock);
+                       if (result != ISC_R_SUCCESS)
+                               goto deallocate_dispatch;
+               }
        }
        disp->socktype = isc_sockettype_udp;
        disp->socket = sock;