mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 09:19:53 +00:00
dns_gethostbyname: return error code if no valid server is set instead of calling the 'found' callback in this case (fixes bug #46887)
This commit is contained in:
parent
80cc988f2f
commit
5cf802eda0
@ -1474,6 +1474,11 @@ dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr, dns_found_call
|
|||||||
LWIP_UNUSED_ARG(dns_addrtype);
|
LWIP_UNUSED_ARG(dns_addrtype);
|
||||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||||
|
|
||||||
|
/* prevent calling found callback if no server is set, return error instead */
|
||||||
|
if (ip_addr_isany_val(dns_servers[0])) {
|
||||||
|
return ERR_VAL;
|
||||||
|
}
|
||||||
|
|
||||||
/* queue query with specified callback */
|
/* queue query with specified callback */
|
||||||
return dns_enqueue(hostname, hostnamelen, found, callback_arg LWIP_DNS_ADDRTYPE_ARG(dns_addrtype));
|
return dns_enqueue(hostname, hostnamelen, found, callback_arg LWIP_DNS_ADDRTYPE_ARG(dns_addrtype));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user