From b1b1be2a569fb9226fa1ebbfed91f34322ce1c9c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 23 Jan 2014 20:41:33 -0800 Subject: [PATCH] engine: pass in right protocol family on host lookup Signed-off-by: Jens Axboe --- engines/net.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.25.1