Signed-off-by: Jens Axboe <axboe@kernel.dk>
return 0;
memset(&hints, 0, sizeof(hints));
return 0;
memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_UNSPEC;
if (is_tcp(o))
hints.ai_socktype = SOCK_STREAM;
else
hints.ai_socktype = SOCK_DGRAM;
if (is_tcp(o))
hints.ai_socktype = SOCK_STREAM;
else
hints.ai_socktype = SOCK_DGRAM;
+ if (is_ipv6(o))
+ hints.ai_family = AF_INET6;
+ else
+ hints.ai_family = AF_INET;
+
ret = getaddrinfo(host, NULL, &hints, res);
if (ret) {
int e = EINVAL;
ret = getaddrinfo(host, NULL, &hints, res);
if (ret) {
int e = EINVAL;