mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
sock_dns: return error if DNS server is not set
This commit is contained in:
parent
1916c45dc0
commit
5361c4cfff
@ -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 reply_buf[512];
|
||||
|
||||
if (sock_dns_server.port == 0) {
|
||||
return -ECONNREFUSED;
|
||||
}
|
||||
|
||||
if (strlen(domain_name) > SOCK_DNS_MAX_NAME_LEN) {
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user