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
This commit is contained in:
nott 2008-10-19 17:29:03 +00:00
parent c493c23d14
commit ca3c374059
3 changed files with 41 additions and 18 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;