mosh.pl: Add a better error message for IPV6 & Socket::IP.
This commit is contained in:
+15
-4
@@ -172,12 +172,23 @@ 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 {
|
my $have_ipv6 = eval {
|
||||||
eval { require IO::Socket::IP; IO::Socket::IP->import('-register'); 1 } or
|
require IO::Socket::IP;
|
||||||
eval { require IO::Socket::INET6 };
|
IO::Socket::IP->import('-register');
|
||||||
}
|
1;
|
||||||
|
} || eval {
|
||||||
|
require IO::Socket::INET6;
|
||||||
|
1;
|
||||||
|
};
|
||||||
use POSIX qw(_exit);
|
use POSIX qw(_exit);
|
||||||
|
|
||||||
|
# Report failure if IPv6 needed and not available.
|
||||||
|
if (lc($family) eq "inet6") {
|
||||||
|
if (!$have_ipv6) {
|
||||||
|
die "$0: IPv6 sockets not available in this Perl install\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my ( $host, $port ) = @ARGV;
|
my ( $host, $port ) = @ARGV;
|
||||||
|
|
||||||
# Resolve hostname and connect
|
# Resolve hostname and connect
|
||||||
|
|||||||
Reference in New Issue
Block a user