From: Jens Axboe Date: Fri, 24 Jan 2014 04:41:33 +0000 (-0800) Subject: engine: pass in right protocol family on host lookup X-Git-Tag: fio-2.1.5~34 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=b1b1be2a569fb9226fa1ebbfed91f34322ce1c9c engine: pass in right protocol family on host lookup Signed-off-by: Jens Axboe --- diff --git a/engines/net.c b/engines/net.c index 4ba4a5f8..5fdc88ce 100644 --- a/engines/net.c +++ b/engines/net.c @@ -857,13 +857,17 @@ static int fio_fill_addr(struct thread_data *td, const char *host, int af, 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_ipv6(o)) + hints.ai_family = AF_INET6; + else + hints.ai_family = AF_INET; + ret = getaddrinfo(host, NULL, &hints, res); if (ret) { int e = EINVAL;