mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-15 10:50:28 +00:00
kept the original logic for classless networks bigger than /24(multiple zones).
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9290 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
@ -132,8 +132,14 @@ sub get_reverse_zones_for_entity {
|
||||
if ($net =~ /\./) { #IPv4/IN-ADDR.ARPA case.
|
||||
my $maskstr = unpack("B32",pack("N",$ctx->{nets}->{$net}->{mask}));
|
||||
my $maskcount = ($maskstr =~ tr/1//);
|
||||
$maskcount-=($maskcount%8); #e.g. treat the 27bit netmask as 24bit
|
||||
#$maskcount+=((8-($maskcount%8))%8); #round to the next octet
|
||||
if ($maskcount >= 24)
|
||||
{
|
||||
$maskcount-=($maskcount%8); #e.g. treat the 27bit netmask as 24bit
|
||||
}
|
||||
else
|
||||
{
|
||||
$maskcount+=((8-($maskcount%8))%8); #round to the next octet
|
||||
}
|
||||
my $newmask = 2**$maskcount -1 << (32 - $maskcount);
|
||||
my $rev = inet_ntoa(pack("N",($tvar & $newmask)));
|
||||
my @zone;
|
||||
|
Reference in New Issue
Block a user