From 90b611cb85d13f1034183c5c1756be567975d75c Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 29 May 2009 13:53:49 +0000 Subject: [PATCH] -Fix IPv6 usage git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3457 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Client.pm | 4 ++-- xCAT-server/sbin/xcatd | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index 0b7f62bc3..91c3f61d2 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -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() }; } diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index ccecfc6bd..18673092b 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -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;