From b3897b05cbe2d1323d45aa6c525eaad0c0b76bab Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 7 May 2010 10:28:30 +0000 Subject: [PATCH] ipv6 fix git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6019 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Utils.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 5e799daf3..ae750f5d6 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -2532,22 +2532,21 @@ sub thishostisnot { @ips = split /\n/, `/sbin/ip addr`; } - my $comp = inet_aton($comparison); + my $comp = xCAT::Utils->getipaddr($comparison); if ($comp) { foreach (@ips) { - if (/^\s*inet\s+/) + if (/^\s*inet.?\s+/) { my @ents = split(/\s+/); my $ip = $ents[2]; $ip =~ s/\/.*//; - if (inet_aton($ip) eq $comp) + $ip =~ s/\%.*//; + if ($ip eq $comp) { return 0; } - - #print Dumper(inet_aton($ip)); } } }