Changeset 332
- Timestamp:
- 05/09/12 20:22:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r331 r332 843 843 } 844 844 # Split and reverse the order of the nibbles in the network/broadcast IPs 845 $prefix =~ s/0$// if $zone->masklen % 4 == 0; # trim another 0 for nibble-aligned blocks first 845 # trim another 0 for nibble-aligned blocks first, but only if we really have a block, not an IP 846 $prefix =~ s/0$// if $zone->masklen % 4 == 0 && $zone->masklen != 128; 846 847 my @nbits = reverse split //, $prefix; 847 848 my @bbits = reverse split //, $bc; … … 4147 4148 } elsif ($typemap{$type} eq 'PTR') { 4148 4149 4149 # must handle both IPv4 and IPv6 4150 ##work 4151 # data should already be in suitable reverse order. 4152 print $datafile "^$host:$val:$ttl:$stamp:$loc\n"; 4150 $zone = NetAddr::IP->new($zone); 4151 if (!$zone->{isv6} && $zone->masklen > 24) { 4152 ($val) = ($val =~ /\.(\d+)$/); 4153 print $datafile "^$val."._ZONE($zone, 'ZONE', 'r', '.').'.in-addr.arpa'. 4154 ":$host:ttl:$stamp:$loc\n"; 4155 } else { 4156 $val = NetAddr::IP->new($val); 4157 print $datafile "^". 4158 _ZONE($val, 'ZONE', 'r', '.').($val->{isv6} ? '.ip6.arpa' : '.in-addr.arpa'). 4159 ":$host:ttl:$stamp:$loc\n"; 4160 } 4153 4161 4154 4162 } else {
Note:
See TracChangeset
for help on using the changeset viewer.