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
This commit is contained in:
jbjohnso 2012-04-14 16:09:22 +00:00
parent 4a3676c987
commit 978d0e5876

View File

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