{
struct addrinfo *local = NULL, *src = NULL, *remote = NULL,
*dst = NULL, hints;
- unsigned int l3type = AF_UNSPEC;
int rc, on = 1, sockfd = -1,
socktype = sock_type(l4type);
char port[6]; /* port number has at most 5 digits */
sprintf(port, "%u", port_number);
/* Set up address hint structure */
memset(&hints, 0, sizeof(hints));
- hints.ai_family = l3type;
+ hints.ai_family = AF_UNSPEC;
hints.ai_socktype = socktype;
/*
* getaddrinfo does not support SOCK_DCCP, so for the sake of lookup
/* only use addresses available on the host */
hints.ai_flags = AI_ADDRCONFIG;
- if (l3type == AF_INET6)
- /* use v4-mapped-v6 if no v6 addresses found */
- hints.ai_flags |= AI_V4MAPPED | AI_ALL;
if (passive && host == NULL)
hints.ai_flags |= AI_PASSIVE;