Skip to content

Commit

Permalink
dns_server: fix race issue regarding rcode.
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Mar 4, 2024
1 parent 28ab061 commit 04d68e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dns_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,10 @@ static int _dns_server_request_complete_with_all_IPs(struct dns_request *request
request->ip_addr[9], request->ip_addr[10], request->ip_addr[11], request->ip_addr[12],
request->ip_addr[13], request->ip_addr[14], request->ip_addr[15]);
}

if (request->rcode == DNS_RC_SERVFAIL && request->has_ip) {
request->rcode = DNS_RC_NOERROR;
}
}

out:
Expand Down Expand Up @@ -7826,7 +7830,6 @@ static int _dns_server_tcp_process_one_request(struct dns_server_conn_tcp_client
goto errout;
}


if (http_decode_data == NULL) {
http_decode_data = malloc(DNS_IN_PACKSIZE);
if (http_decode_data == NULL) {
Expand Down

0 comments on commit 04d68e7

Please sign in to comment.