Skip to content

Commit

Permalink
dns_client: fix bootstrap dns resolve failed issue when response mode…
Browse files Browse the repository at this point in the history
… is fastest.
  • Loading branch information
pymumu committed Sep 21, 2024
1 parent 1d9c11a commit 84f217d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dns_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -4309,7 +4309,7 @@ static int _dns_client_pending_server_resolve(const struct dns_result *result, v
int has_soa = 0;

if (result->rtcode == DNS_RC_NXDOMAIN || result->has_soa == 1 || result->rtcode == DNS_RC_REFUSED ||
(result->rtcode == DNS_RC_NOERROR && result->ip_num == 0)) {
(result->rtcode == DNS_RC_NOERROR && result->ip_num == 0 && result->ip == NULL)) {
has_soa = 1;
}

Expand Down
5 changes: 4 additions & 1 deletion src/dns_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -4411,7 +4411,10 @@ static int _dns_server_get_answer(struct dns_server_post_context *context)
continue;
}

_dns_server_context_add_ip(context, addr_map->ip_addr);
if (addr_map != NULL) {
_dns_server_context_add_ip(context, addr_map->ip_addr);
}

if (request->has_ip == 1) {
continue;
}
Expand Down

0 comments on commit 84f217d

Please sign in to comment.