mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-15 09:33:50 +01:00
net/util: make use of dns_query()
This commit is contained in:
parent
9a9abb4f58
commit
e128736014
@ -20,9 +20,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "net/utils.h"
|
||||
#if defined(MODULE_SOCK_DNS) || defined(MODULE_SOCK_DNS_MOCK)
|
||||
#if defined(MODULE_DNS)
|
||||
#include "net/af.h"
|
||||
#include "net/sock/dns.h"
|
||||
#include "net/dns.h"
|
||||
#endif
|
||||
|
||||
/* get the next netif, returns true if there are more */
|
||||
@ -48,7 +48,7 @@ int netutils_get_ipv4(ipv4_addr_t *addr, const char *hostname)
|
||||
/* once we see an invalid character for an IPv4 address try to
|
||||
* resolve the hostname by DNS */
|
||||
if (is_not_ipv4) {
|
||||
int res = sock_dns_query(hostname, addr, AF_INET);
|
||||
int res = dns_query(hostname, addr, AF_INET);
|
||||
if (res < 0) {
|
||||
return res;
|
||||
}
|
||||
@ -80,7 +80,7 @@ int netutils_get_ipv6(ipv6_addr_t *addr, netif_t **netif, const char *hostname)
|
||||
#if defined(MODULE_SOCK_DNS) || defined(MODULE_SOCK_DNS_MOCK)
|
||||
/* hostname is not an IPv6 address */
|
||||
if (strchr(hostname, ':') == NULL) {
|
||||
int res = sock_dns_query(hostname, addr, AF_INET6);
|
||||
int res = dns_query(hostname, addr, AF_INET6);
|
||||
if (res < 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -29,8 +29,8 @@
|
||||
#include "net/sock/udp.h"
|
||||
#include "net/sock/util.h"
|
||||
|
||||
#if defined(MODULE_SOCK_DNS) || defined(MODULE_SOCK_DNS_MOCK)
|
||||
#include "net/sock/dns.h"
|
||||
#if defined(MODULE_DNS)
|
||||
#include "net/dns.h"
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_FMT
|
||||
@ -306,7 +306,7 @@ int sock_tl_name2ep(struct _sock_tl_ep *ep_out, const char *str)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (sock_dns_query(host, &ep_out->addr, family)) {
|
||||
switch (dns_query(host, &ep_out->addr, family)) {
|
||||
#ifdef SOCK_HAS_IPV4
|
||||
case 4:
|
||||
ep_out->family = AF_INET;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user