From: Mark Andrews Date: Fri, 11 Jan 2013 03:10:07 +0000 (+1100) Subject: 3465. [bug] Handle isolated reserved ports. [RT #31778] X-Git-Tag: v9.10.0a1~580 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=99394e9807411cbbeb9814b603c7dfa3b569388e;p=thirdparty%2Fbind9.git 3465. [bug] Handle isolated reserved ports. [RT #31778] --- diff --git a/CHANGES b/CHANGES index 7314caa79ab..da861f06b83 100644 --- 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] diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index b9086b737b6..08c800ef5b3 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -2949,12 +2949,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, NULL); - 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); } /*