diff options
author | reyk <> | 2015-02-08 04:12:34 +0000 |
---|---|---|
committer | reyk <> | 2015-02-08 04:12:34 +0000 |
commit | 653ed322d15a6087960710834e7221c7ff8b0af1 (patch) | |
tree | fce44d8ce9c2f2c7e3e34ed502c9843f8f1978b0 /src | |
parent | c3aa9e0ac657cbb4f52610c81e0b717fef4a556e (diff) | |
download | openbsd-653ed322d15a6087960710834e7221c7ff8b0af1.tar.gz openbsd-653ed322d15a6087960710834e7221c7ff8b0af1.tar.bz2 openbsd-653ed322d15a6087960710834e7221c7ff8b0af1.zip |
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@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libtls/tls_client.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ | |||
1 | /* $OpenBSD: tls_client.c,v 1.11 2015/02/07 09:50:09 jsing Exp $ */ | 1 | /* $OpenBSD: tls_client.c,v 1.12 2015/02/08 04:12:34 reyk Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -82,6 +82,7 @@ tls_connect(struct tls *ctx, const char *host, const char *port) | |||
82 | memset(&hints, 0, sizeof(hints)); | 82 | memset(&hints, 0, sizeof(hints)); |
83 | hints.ai_family = AF_UNSPEC; | 83 | hints.ai_family = AF_UNSPEC; |
84 | hints.ai_socktype = SOCK_STREAM; | 84 | hints.ai_socktype = SOCK_STREAM; |
85 | hints.ai_flags = AI_ADDRCONFIG; | ||
85 | 86 | ||
86 | if ((ret = getaddrinfo(h, p, &hints, &res0)) != 0) { | 87 | if ((ret = getaddrinfo(h, p, &hints, &res0)) != 0) { |
87 | tls_set_error(ctx, "%s", gai_strerror(ret)); | 88 | tls_set_error(ctx, "%s", gai_strerror(ret)); |