Skip to content
Commit 5da0d292 authored by Stig Bjørlykke's avatar Stig Bjørlykke Committed by Jukka Rissanen
Browse files

net: dns: Fix end-of-results callback on error



Callers of dns_get_addr_info() depends on receiving an end-of-results
callback (where 'info' is NULL) when finished. Do this on failure in
cb_recv() instead of pointing to an empty object.

This fix will avoid a deadlock situation in getaddrinfo().

A reply code other than "no error" in the DNS response is a typical
case when the lookup failed and this occurs.

Moved "struct dns_addrinfo info" variable from cb_recv() to dns_read()
because it was now unused in cb_recv().

Adding tests for this requires network access and a DNS server,
or a mechanism for generating a DNS response with a reply code.

Signed-off-by: default avatarStig Bjørlykke <stig.bjorlykke@nordicsemi.no>
parent e652b748
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment