]> 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:00 +0000 (21:39 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Tue, 28 Apr 2009 21:39:00 +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 2c0969c74aa796db595e5e41b10aac557a8c5677..4d9925844172325a7b97345aa3c3475d54d321ed 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]
+
 2587.  [func]          Improve logging by reporting serial numbers for
                        when zone serial has gone backwards or unchanged.
                        [RT #19506]
index a0b7be70b16947ea7b3915338d7bd709b3bca2f3..9103dd69d923f162ce7df7fe12ef2b9328f99614 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dispatch.c,v 1.162 2009/01/31 00:37:04 marka Exp $ */
+/* $Id: dispatch.c,v 1.163 2009/04/28 21:39:00 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;