mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
Bind socket before use
This commit is contained in:
parent
7257176e6f
commit
2004704111
@ -432,6 +432,7 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
|||||||
isc_socket_t *socket = NULL;
|
isc_socket_t *socket = NULL;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
isc_mem_t *mctx;
|
isc_mem_t *mctx;
|
||||||
|
isc_sockaddr_t bind_any;
|
||||||
isc_interval_t interval;
|
isc_interval_t interval;
|
||||||
dns_messageid_t id;
|
dns_messageid_t id;
|
||||||
isc_time_t expires;
|
isc_time_t expires;
|
||||||
@ -499,6 +500,12 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
|||||||
isc_sockettype_tcp, &socket);
|
isc_sockettype_tcp, &socket);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
isc_sockaddr_any(&bind_any);
|
||||||
|
result = isc_socket_bind(sock, &bind_any);
|
||||||
|
if (result != ISC_R_SUCCESS) {
|
||||||
|
isc_socket_detach(&socket);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
attrs = 0;
|
attrs = 0;
|
||||||
attrs |= DNS_DISPATCHATTR_TCP;
|
attrs |= DNS_DISPATCHATTR_TCP;
|
||||||
attrs |= DNS_DISPATCHATTR_PRIVATE;
|
attrs |= DNS_DISPATCHATTR_PRIVATE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user