Skip to content
Snippets Groups Projects
Commit dce921c1 authored by Librae's avatar Librae Committed by Gregory Nutt
Browse files

Check if DNS server has been initialized before trying to lookup the server...

Check if DNS server has been initialized before trying to lookup the server address in the cache.  From Librae
parent e66e2f5c
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment