From 978d0e587636380dc329bd6827b7e7cb3148a2d2 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sat, 14 Apr 2012 16:09:22 +0000 Subject: [PATCH] Fix NetworkUtils.pm to work correctly with IPv6 nets with '/64' in netmask field git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12236 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/NetworkUtils.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index f8ba36b9e..405f6efbe 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -365,7 +365,12 @@ sub ishostinsubnet { $numbits=128; } if ($mask) { - $mask=getipaddr($mask,GetNumber=>1); + if ($mask =~ /\//) { + $mask =~ s/^\///; + $mask=Math::BigInt->new("0b".("1"x$mask).("0"x($numbits-$mask))); + } else { + $mask=getipaddr($mask,GetNumber=>1); + } } else { #CIDR notation supported if ($subnet =~ /\//) { ($subnet,$mask) = split /\//,$subnet,2;