Skip to content

Commit

Permalink
net: disable name resolution in net_resolve_address()
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Jun 22, 2021
1 parent e30554a commit 75cf66f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/net/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,14 @@ int net_default_gateway_get(int af, struct sa *gw)
int net_resolve_address(const char *addr, struct sa *sa)
{
struct addrinfo *res, *res0;
struct addrinfo hints;
int err;

err = getaddrinfo(addr, NULL, NULL, &res0);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | AI_NUMERICHOST;

err = getaddrinfo(addr, NULL, &hints, &res0);
if (err) {
DEBUG_WARNING("getaddrinfo(): (%s)\n", gai_strerror(err));
err = EADDRNOTAVAIL;
Expand Down

0 comments on commit 75cf66f

Please sign in to comment.