2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

2396. [bug] Don't set SO_REUSEADDR for randomized ports.

[RT #18336]
part 2
This commit is contained in:
Mark Andrews
2008-07-23 23:27:54 +00:00
parent 5df5127aa4
commit 240e53b132
12 changed files with 46 additions and 35 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dispatch.c,v 1.148 2008/07/22 03:43:04 marka Exp $ */
/* $Id: dispatch.c,v 1.149 2008/07/23 23:27:54 marka Exp $ */
/*! \file */
@@ -304,7 +304,7 @@ static isc_result_t qid_allocate(dns_dispatchmgr_t *mgr, unsigned int buckets,
isc_boolean_t needaddrtable);
static void qid_destroy(isc_mem_t *mctx, dns_qid_t **qidp);
static isc_result_t open_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local,
int reuseaddr, isc_socket_t **sockp);
unsigned int options, isc_socket_t **sockp);
static isc_boolean_t portavailable(dns_dispatchmgr_t *mgr, isc_socket_t *sock,
isc_sockaddr_t *sockaddrp);
@@ -1586,8 +1586,8 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) {
}
static isc_result_t
open_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local, int reuseaddr,
isc_socket_t **sockp)
open_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local,
unsigned int options, isc_socket_t **sockp)
{
isc_socket_t *sock;
isc_result_t result;
@@ -1608,7 +1608,7 @@ open_socket(isc_socketmgr_t *mgr, isc_sockaddr_t *local, int reuseaddr,
#ifndef ISC_ALLOW_MAPPED
isc_socket_ipv6only(sock, ISC_TRUE);
#endif
result = isc_socket_bind(sock, local, reuseaddr);
result = isc_socket_bind(sock, local, options);
if (result != ISC_R_SUCCESS) {
if (*sockp == NULL)
isc_socket_detach(&sock);