From 653ed322d15a6087960710834e7221c7ff8b0af1 Mon Sep 17 00:00:00 2001 From: reyk <> Date: Sun, 8 Feb 2015 04:12:34 +0000 Subject: Use the AI_ADDRCONFIG flag in tls_connect(). This tells the resolver to ignore unsupported address families - eg. don't resolv IPv6 on IPv4-only hosts. OK jsing@ --- src/lib/libtls/tls_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/libtls/tls_client.c b/src/lib/libtls/tls_client.c index 85733cdd5e..0894ce6333 100644 --- a/src/lib/libtls/tls_client.c +++ b/src/lib/libtls/tls_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_client.c,v 1.11 2015/02/07 09:50:09 jsing Exp $ */ +/* $OpenBSD: tls_client.c,v 1.12 2015/02/08 04:12:34 reyk Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -82,6 +82,7 @@ tls_connect(struct tls *ctx, const char *host, const char *port) memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG; if ((ret = getaddrinfo(h, p, &hints, &res0)) != 0) { tls_set_error(ctx, "%s", gai_strerror(ret)); -- cgit v1.2.3-55-g6feb