=item B<have_IPv6>
Return true if IPv4 / IPv6 is possible to use on the current system.
+Additionally, B<have_IPv6> also checks how OpenSSL was configured,
+i.e. if IPv6 was explicitly disabled with -DOPENSSL_USE_IPv6=0.
=back
our %available_protocols;
our %disabled;
our %config;
+our %target;
my $configdata_loaded = 0;
sub load_configdata {
%available_protocols = %configdata::available_protocols;
%disabled = %configdata::disabled;
%config = %configdata::config;
+ %target = %configdata::target;
};
$configdata_loaded = 1;
}
}
sub have_IPv6 {
+ if ($have_IPv6 < 0) {
+ load_configdata() unless $configdata_loaded;
+ # If OpenSSL is configured with IPv6 explicitly disabled, no IPv6
+ # related tests should be performed. In other words, pretend IPv6
+ # isn't present.
+ $have_IPv6 = 0
+ if grep { $_ eq 'OPENSSL_USE_IPV6=0' } @{$config{CPPDEFINES}};
+ # Similarly, if a config target has explicitly disabled IPv6, no
+ # IPv6 related tests should be performed.
+ $have_IPv6 = 0
+ if grep { $_ eq 'OPENSSL_USE_IPV6=0' } @{$target{defines}};
+ }
if ($have_IPv6 < 0) {
$have_IPv6 = check_IP("::1");
}