[openssl-commits] [openssl] master update
Richard Levitte
levitte at openssl.org
Sun Feb 14 06:39:29 UTC 2016
The branch master has been updated
via 98ac876f2ded90de8c9d9bc9d7b33a965f7d9f9a (commit)
from c8d1c9b06768bab700a3364639614202842eea42 (commit)
- Log -----------------------------------------------------------------
commit 98ac876f2ded90de8c9d9bc9d7b33a965f7d9f9a
Author: Richard Levitte <levitte at openssl.org>
Date: Sun Feb 14 07:10:38 2016 +0100
Prefer IO::Socket::INET6 over IO::Socket::IP
While IO::Socket::IP is a core perl module (since Perl v5.19.8, or so
says corelist), IO::Socket::INET6 has been around longer, is said to
be more widely deployed, and most importantly, seems to have less bugs
hitting us. We therefore prefer IO::Socket::INET6, and only fall back
to IO::Socket::IP if the former doesn't exist on the local system.
Reviewed-by: Viktor Dukhovni <viktor at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
util/TLSProxy/Proxy.pm | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm
index 45871b8..9883901 100644
--- a/util/TLSProxy/Proxy.pm
+++ b/util/TLSProxy/Proxy.pm
@@ -98,9 +98,14 @@ sub new
message_list => [],
};
+ # IO::Socket::IP is on the core module list, IO::Socket::INET6 isn't.
+ # However, IO::Socket::INET6 is older and is said to be more widely
+ # deployed for the moment, and may have less bugs, so we try the latter
+ # first, then fall back on the code modules. Worst case scenario, we
+ # fall back to IO::Socket::INET, only supports IPv4.
eval {
- require IO::Socket::IP;
- my $s = IO::Socket::IP->new(
+ require IO::Socket::INET6;
+ my $s = IO::Socket::INET6->new(
LocalAddr => "::1",
LocalPort => 0,
Listen=>1,
@@ -109,13 +114,12 @@ sub new
$s->close();
};
if ($@ eq "") {
- # IO::Socket::IP supports IPv6 and is in the core modules list
- $IP_factory = sub { IO::Socket::IP->new(@_); };
+ $IP_factory = sub { IO::Socket::INET6->new(@_); };
$have_IPv6 = 1;
} else {
eval {
- require IO::Socket::INET6;
- my $s = IO::Socket::INET6->new(
+ require IO::Socket::IP;
+ my $s = IO::Socket::IP->new(
LocalAddr => "::1",
LocalPort => 0,
Listen=>1,
@@ -124,14 +128,9 @@ sub new
$s->close();
};
if ($@ eq "") {
- # IO::Socket::INET6 supports IPv6 but isn't on the core modules list
- # However, it's a bit older and said to be more widely deployed
- # at the time of writing this comment.
- $IP_factory = sub { IO::Socket::INET6->new(@_); };
+ $IP_factory = sub { IO::Socket::IP->new(@_); };
$have_IPv6 = 1;
} else {
- # IO::Socket::INET doesn't support IPv6 but is a fallback in case
- # we have no other.
$IP_factory = sub { IO::Socket::INET->new(@_); };
}
}
More information about the openssl-commits
mailing list