4535. [bug] Address race condition in setting / testing of

DNS_REQUEST_F_SENDING. [RT #43889]

(cherry picked from commit 37a8db0ba4)
This commit is contained in:
Mark Andrews
2016-12-14 10:31:26 +11:00
parent 0bd4d32e3d
commit 3fe3359031
2 changed files with 6 additions and 2 deletions

View File

@@ -1,3 +1,6 @@
4535. [bug] Address race condition in setting / testing of
DNS_REQUEST_F_SENDING. [RT #43889]
4534. [bug] Only set RD, RA and CD in QUERY responses. [RT #43879]
4533. [bug] dns_client_update should terminate on prerequisite

View File

@@ -439,10 +439,11 @@ req_send(dns_request_t *request, isc_task_t *task, isc_sockaddr_t *address) {
* as we do in resolver.c, but we prefer implementation simplicity
* at this moment.
*/
request->flags |= DNS_REQUEST_F_SENDING;
result = isc_socket_sendto(sock, &r, task, req_senddone,
request, address, NULL);
if (result == ISC_R_SUCCESS)
request->flags |= DNS_REQUEST_F_SENDING;
if (result != ISC_R_SUCCESS)
request->flags &= ~DNS_REQUEST_F_SENDING;
return (result);
}