-Fix reverse zone names

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6486 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2010-06-16 18:23:30 +00:00
parent 1ae4225dbe
commit 8bb334af07
2 changed files with 14 additions and 0 deletions

View File

@ -975,6 +975,7 @@ sub getzonesfornet {
$netnum = $netnum & 0xffffff00;
$netn = pack('N',$netnum);
$net = inet_ntoa($netn);
$net =~ s/\.[^\.]*$//;
return (join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.');
} elsif ($masknum > 0xffff0000) { #class b (/16) to /23
my $tempnumber = ($netnum >> 8);
@ -983,6 +984,7 @@ sub getzonesfornet {
foreach ($tempnumber..$highnet) {
$netnum = $_ << 8;
$net = inet_ntoa(pack('N',$netnum));
$net =~ s/\.[^\.]*$//;
push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.';
}
return @zones;
@ -993,6 +995,8 @@ sub getzonesfornet {
foreach ($tempnumber..$highnet) {
$netnum = $_ << 16; #convert back to the real network value
$net = inet_ntoa(pack('N',$netnum));
$net =~ s/\.[^\.]*$//;
$net =~ s/\.[^\.]*$//;
push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.';
}
return @zones;
@ -1003,6 +1007,9 @@ sub getzonesfornet {
foreach ($tempnumber..$highnet) {
$netnum = $_ << 24; #convert back to the real network value
$net = inet_ntoa(pack('N',$netnum));
$net =~ s/\.[^\.]*$//;
$net =~ s/\.[^\.]*$//;
$net =~ s/\.[^\.]*$//;
push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.';
}
return @zones;

View File

@ -35,6 +35,7 @@ sub getzonesfornet {
$netnum = $netnum & 0xffffff00;
$netn = pack('N',$netnum);
$net = inet_ntoa($netn);
$net =~ s/\.[^\.]*$//;
return (join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.');
} elsif ($masknum > 0xffff0000) { #(/17) to /23
my $tempnumber = ($netnum >> 8);
@ -43,6 +44,7 @@ sub getzonesfornet {
foreach ($tempnumber..$highnet) {
$netnum = $_ << 8;
$net = inet_ntoa(pack('N',$netnum));
$net =~ s/\.[^\.]*$//;
push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.';
}
return @zones;
@ -53,6 +55,8 @@ sub getzonesfornet {
foreach ($tempnumber..$highnet) {
$netnum = $_ << 16; #convert back to the real network value
$net = inet_ntoa(pack('N',$netnum));
$net =~ s/\.[^\.]*$//;
$net =~ s/\.[^\.]*$//;
push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.';
}
return @zones;
@ -63,6 +67,9 @@ sub getzonesfornet {
foreach ($tempnumber..$highnet) {
$netnum = $_ << 24; #convert back to the real network value
$net = inet_ntoa(pack('N',$netnum));
$net =~ s/\.[^\.]*$//;
$net =~ s/\.[^\.]*$//;
$net =~ s/\.[^\.]*$//;
push @zones,join('.',reverse(split('\.',$net))).'.IN-ADDR.ARPA.';
}
return @zones;