]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3465. [bug] Handle isolated reserved ports. [RT #31778]
authorMark Andrews <marka@isc.org>
Fri, 11 Jan 2013 03:10:07 +0000 (14:10 +1100)
committerMark Andrews <marka@isc.org>
Fri, 11 Jan 2013 03:12:18 +0000 (14:12 +1100)
CHANGES
lib/dns/dispatch.c

diff --git a/CHANGES b/CHANGES
index 0729173e3de95560766ae3a59deccd108663236a..724956c0f0f3df5e3379b6ee847b61e37af75393 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3465.  [bug]           Handle isolated reserved ports. [RT #31778]
+
 3464.  [maint]         Updates to PKCS#11 openssl patches, supporting
                        versions 0.9.8x, 1.0.0j, 1.0.1c [RT #29749]
 
index bdd11dd9ce13a5cf67b0ec53179ae56a29f66b03..d7c9cf3920d91726b34a762fa6a630e50bf9914b 100644 (file)
@@ -2775,12 +2775,16 @@ get_udpsocket(dns_dispatchmgr_t *mgr, dns_dispatch_t *disp,
                        isc_sockaddr_setport(&localaddr_bound, prt);
                        result = open_socket(sockmgr, &localaddr_bound,
                                             0, &sock);
-                       if (result == ISC_R_SUCCESS ||
-                           result != ISC_R_ADDRINUSE) {
-                               disp->localport = prt;
-                               *sockp = sock;
-                               return (result);
-                       }
+                       /*
+                        * Continue if the port choosen is already in use
+                        * or the OS has reserved it.
+                        */
+                       if (result == ISC_R_NOPERM ||
+                           result == ISC_R_ADDRINUSE)
+                               continue;
+                       disp->localport = prt;
+                       *sockp = sock;
+                       return (result);
                }
 
                /*