Skip to content
Snippets Groups Projects
Commit 5361c4cf authored by Martine Lenders's avatar Martine Lenders Committed by Martine Lenders
Browse files

sock_dns: return error if DNS server is not set

parent 1916c45d
No related branches found
No related tags found
No related merge requests found
...@@ -135,6 +135,10 @@ int sock_dns_query(const char *domain_name, void *addr_out, int family) ...@@ -135,6 +135,10 @@ int sock_dns_query(const char *domain_name, void *addr_out, int family)
uint8_t buf[SOCK_DNS_QUERYBUF_LEN]; uint8_t buf[SOCK_DNS_QUERYBUF_LEN];
uint8_t reply_buf[512]; uint8_t reply_buf[512];
if (sock_dns_server.port == 0) {
return -ECONNREFUSED;
}
if (strlen(domain_name) > SOCK_DNS_MAX_NAME_LEN) { if (strlen(domain_name) > SOCK_DNS_MAX_NAME_LEN) {
return -ENOSPC; return -ENOSPC;
} }
......
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