Check if DNS server has been initialized before trying to lookup the server address in the cache. From Librae
This commit is contained in:
parent
e66e2f5c0f
commit
dce921c1cd
@ -1029,6 +1029,14 @@ int dns_find_answer(FAR const char *hostname, FAR struct sockaddr *addr,
|
||||
int next;
|
||||
int ndx;
|
||||
|
||||
/* If DNS not initialized, no need to proceed */
|
||||
|
||||
if (!g_dns_initialized)
|
||||
{
|
||||
ndbg("ERROR: DNS not initialized yet\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
/* Get exclusive access to the DNS cache */
|
||||
|
||||
dns_semtake();
|
||||
|
Loading…
Reference in New Issue
Block a user