]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2588. [bug] SO_REUSEADDR could be set unconditionally after failure
authorTatuya JINMEI 神明達哉 <jinmei@isc.org>
Tue, 28 Apr 2009 21:39:45 +0000 (21:39 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Tue, 28 Apr 2009 21:39:45 +0000 (21:39 +0000)
of bind(2) call.  This should be rare and mostly
harmless, but may cause interference with other
processes that happen to use the same port. [RT #19642]

CHANGES
lib/dns/dispatch.c

diff --git a/CHANGES b/CHANGES
index 7d621f9a48c0f665678a460419f85899dbf5796c..e1fc16dc030c5ba3af5e3b42060dd05bb87800b8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+2588.  [bug]           SO_REUSEADDR could be set unconditionally after failure
+                       of bind(2) call.  This should be rare and mostly
+                       harmless, but may cause interference with other
+                       processes that happen to use the same port. [RT #19642]
+
 2586.  [bug]           Missing cleanup of SIG rdataset in searching a DLZ DB
                        or SDB. [RT #19577]
 
index 1356134dec42907f9aa124e2b4c5861267d8fa47..9b4e9685f4086dc9eb43f306ac65af7ca0338973 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dispatch.c,v 1.155.12.6 2009/01/31 00:38:25 marka Exp $ */
+/* $Id: dispatch.c,v 1.155.12.7 2009/04/28 21:39:45 jinmei Exp $ */
 
 /*! \file */
 
@@ -808,7 +808,7 @@ get_dispsocket(dns_dispatch_t *disp, isc_sockaddr_t *dest,
        dispsocket_t *dispsock;
        unsigned int nports;
        in_port_t *ports;
-       unsigned int bindoptions = 0;
+       unsigned int bindoptions;
        dispportentry_t *portentry = NULL;
 
        if (isc_sockaddr_pf(&disp->local) == AF_INET) {
@@ -858,6 +858,7 @@ get_dispsocket(dns_dispatch_t *disp, isc_sockaddr_t *dest,
                bucket = dns_hash(qid, dest, 0, port);
                if (socket_search(qid, dest, port, bucket) != NULL)
                        continue;
+               bindoptions = 0;
                portentry = port_search(disp, port);
                if (portentry != NULL)
                        bindoptions |= ISC_SOCKET_REUSEADDRESS;