scripts/mosh: Allow IO::Socket::INET6 as an alternative to IO::Socket::IP

Some systems have IO::Socket::INET6 preinstalled, so we might as well
accept either.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg
2014-09-29 16:28:50 -04:00
committed by John Hood
parent 14bdd8f00f
commit e7903f0de2
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -123,7 +123,8 @@ Synonym for \-\-predict=never
.TP .TP
.B --family=\fIFAMILY\fP .B --family=\fIFAMILY\fP
Force the use of a particular address family, which defaults to `inet' Force the use of a particular address family, which defaults to `inet'
(IPv4), and can also be `inet6' (IPv6; requires IO::Socket::IP). (IPv4), and can also be `inet6' (IPv6; requires IO::Socket::IP or
IO::Socket::INET6).
.TP .TP
.B -4 .B -4
+4 -1
View File
@@ -172,7 +172,10 @@ if ( not defined $bind_ip or $bind_ip =~ m{^ssh$}i ) {
if ( defined $fake_proxy ) { if ( defined $fake_proxy ) {
use Errno qw(EINTR); use Errno qw(EINTR);
BEGIN { eval { require IO::Socket::IP; IO::Socket::IP->import('-register'); }; } BEGIN {
eval { require IO::Socket::IP; IO::Socket::IP->import('-register'); 1 } or
eval { require IO::Socket::INET6 };
}
use POSIX qw(_exit); use POSIX qw(_exit);
my ( $host, $port ) = @ARGV; my ( $host, $port ) = @ARGV;