-Fix IPv6 usage

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3457 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-05-29 13:53:49 +00:00
parent 610ac90036
commit 90b611cb85
2 changed files with 19 additions and 10 deletions

View File

@ -7,17 +7,17 @@ BEGIN
}
my $inet6support;
use IO::Socket::SSL;
$inet6support=eval { require Socket6 };
if ($inet6support) {
$inet6support = eval { require IO::Socket::INET6 };
}
if ($inet6support) {
$inet6support = eval { require IO::Socket::SSL::inet6 };
$inet6support = eval { require IO::Socket::SSL; IO::Socket::SSL->import('inet6'); };
}
unless ($inet6support) {
eval { require Socket };
eval { require IO::Socket::INET };
eval { require IO::Socket::SSL; IO::Socket::SSL->import() };
}

View File

@ -30,18 +30,18 @@ my $dispatch_children=0;
my %dispatched_children=();
my $plugin_numchildren=0;
my %plugin_children;
use IO::Socket::SSL;
my $inet6support;
$inet6support=eval { require Socket6 };
if ($inet6support) {
$inet6support = eval { require IO::Socket::INET6 };
}
if ($inet6support) {
$inet6support = eval { require IO::Socket::SSL::inet6 };
}
$inet6support = eval { require IO::Socket::SSL; IO::Socket::SSL->import('inet6'); 1; };
}
unless ($inet6support) {
eval { require Socket };
eval { require IO::Socket::INET };
eval { require IO::Socket::SSL; IO::Socket::SSL->import(); };
}
my $dispatch_requests = 1; # govern whether commands are dispatchable
@ -516,11 +516,20 @@ unless ($pid) {
}
$$progname="xcatd: SSL listener";
openlog("xCAT SSL","","local4");
my $listener = IO::Socket::INET->new(
LocalPort => $port,
Listen => 64,
Reuse => 1,
);
my $listener;
if ($inet6support) {
$listener = IO::Socket::INET6->new(
LocalPort => $port,
Listen => 64,
Reuse => 1,
);
} else {
$listener = IO::Socket::INET->new(
LocalPort => $port,
Listen => 64,
Reuse => 1,
);
}
unless ($listener) {
kill 2, $pid;