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/trunk@12237 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-04-14 16:09:38 +00:00
parent db1e95f0c8
commit d5e4736a96

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;