sock_dns: make sock_dns_query() return the length of the address

The implementation already did that, now also reflect this in the
documentation.
This commit is contained in:
Benjamin Valentin 2020-02-24 13:21:18 +01:00
parent 1de14931b8
commit fa4447241f
2 changed files with 3 additions and 3 deletions

View File

@ -80,8 +80,8 @@ typedef struct {
* @param[out] addr_out buffer to write result into
* @param[in] family Either AF_INET, AF_INET6 or AF_UNSPEC
*
* @return 0 on success
* @return !=0 otherwise
* @return the size of the resolved address on success
* @return < 0 otherwise
*/
int sock_dns_query(const char *domain_name, void *addr_out, int family);

View File

@ -178,7 +178,7 @@ static int _configure(int argc, char **argv, _ping_data_t *data)
data->hostname = arg;
#ifdef MODULE_SOCK_DNS
if (strchr(data->hostname, ':') == NULL &&
sock_dns_query(data->hostname, &data->host, AF_INET6) == 0) {
sock_dns_query(data->hostname, &data->host, AF_INET6) > 0) {
res = 0;
continue;
}