From 145c4143ac36b9f1d8c312cadcf960b416635194 Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Mon, 4 Mar 2024 21:55:46 +0800 Subject: [PATCH] dns_server: fix race issue regarding rcode. --- src/dns_server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dns_server.c b/src/dns_server.c index f16fd99092..1a894b4890 100644 --- a/src/dns_server.c +++ b/src/dns_server.c @@ -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_NOERROR) { + request->rcode = DNS_RC_NOERROR; + } } out: @@ -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) {