Skip to content

Commit 579a31d

Browse files
rcsanchez97kevinAlbs
authored andcommitted
CDRIVER-3522 use correct data structure for IPv6
1 parent dedb247 commit 579a31d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libmongoc/src/mongoc/mongoc-stream-tls-openssl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,13 @@ mongoc_stream_tls_openssl_new (mongoc_stream_t *base_stream,
712712
#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
713713
if (!opt->allow_invalid_hostname) {
714714
struct in_addr addr;
715+
struct in6_addr addr6;
715716
X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new ();
716717

717718
X509_VERIFY_PARAM_set_hostflags (param,
718719
X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
719720
if (inet_pton (AF_INET, host, &addr) ||
720-
inet_pton (AF_INET6, host, &addr)) {
721+
inet_pton (AF_INET6, host, &addr6)) {
721722
X509_VERIFY_PARAM_set1_ip_asc (param, host);
722723
} else {
723724
X509_VERIFY_PARAM_set1_host (param, host, 0);

0 commit comments

Comments
 (0)