From ca3c3740592dba54b70ca81904221222c67a68d3 Mon Sep 17 00:00:00 2001 From: nott Date: Sun, 19 Oct 2008 17:29:03 +0000 Subject: [PATCH] Avoid inet6 check for AIX in thishostisnot git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2364 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- mkAIXsnap | 2 +- perl-xCAT/xCAT/Client.pm | 29 ++++++++++++++++++++--------- xCAT-server/sbin/xcatd | 28 ++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/mkAIXsnap b/mkAIXsnap index a3e92e925..a381309bf 100755 --- a/mkAIXsnap +++ b/mkAIXsnap @@ -44,7 +44,7 @@ fi # # do an update from the trunk directory level # -svn update | tee $BLDTOP/coresvnup +#svn update | tee $BLDTOP/coresvnup #svn update # create a simple install script diff --git a/perl-xCAT/xCAT/Client.pm b/perl-xCAT/xCAT/Client.pm index ecb6d10bb..a0af61389 100644 --- a/perl-xCAT/xCAT/Client.pm +++ b/perl-xCAT/xCAT/Client.pm @@ -510,18 +510,29 @@ sub thishostisnot { # TODO: AIX will hang on the inet_aton call if it gets passed an IPv6 # address, since we have not added INET6 support to AIX yet. # The ifconfig -a output may contain an IPv6 address for localhost. -# This code should only get called if using hierarchy, which -# is also not supported for AIX yet. +# This code should only get called if using hierarchy #### my $comp=IO::Socket::inet_aton($comparison); foreach (@ips) { - if (/^\s*inet/) { - my @ents = split(/\s+/); - my $ip=$ents[2]; - $ip =~ s/\/.*//; - if (IO::Socket::inet_aton($ip) eq $comp) { - return 0; - } + if (xCAT::Utils->isAIX()) { + # don't want "inet6" entry - causes error in inet_aton + if (/^\s*inet\s+/) { + my @ents = split(/\s+/); + my $ip=$ents[2]; + $ip =~ s/\/.*//; + if (IO::Socket::inet_aton($ip) eq $comp) { + return 0; + } + } + } else { + if (/^\s*inet/) { + my @ents = split(/\s+/); + my $ip=$ents[2]; + $ip =~ s/\/.*//; + if (IO::Socket::inet_aton($ip) eq $comp) { + return 0; + } + } } } return 1; diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index bbef28a63..dc2e86937 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -949,14 +949,26 @@ sub thishostisnot { return 1; } foreach (@ips) { - if (/^\s*inet/) { - my @ents = split(/\s+/); - my $ip=$ents[2]; - $ip =~ s/\/.*//; - if (inet_aton($ip) and inet_aton($ip) eq $comp) { - return 0; - } - #print Dumper(inet_aton($ip)); + if (xCAT::Utils->isAIX()) { + # don't want "inet6" entry - causes error in inet_aton + if (/^\s*inet\s+/) { + my @ents = split(/\s+/); + my $ip=$ents[2]; + $ip =~ s/\/.*//; + if (inet_aton($ip) and inet_aton($ip) eq $comp) { + return 0; + } + } + } else { + if (/^\s*inet/) { + my @ents = split(/\s+/); + my $ip=$ents[2]; + $ip =~ s/\/.*//; + if (inet_aton($ip) and inet_aton($ip) eq $comp) { + return 0; + } + } + #print Dumper(inet_aton($ip)); } } return 1;