Changeset 865 for trunk/DNSDB
- Timestamp:
- 09/20/22 17:50:30 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB/ExportBIND.pm
r864 r865 47 47 my $zonesth = $dnsdb->{dbh}->prepare("UPDATE revzones SET changed='n' WHERE rdns_id=?"); 48 48 $revsth->execute(); 49 50 my %recflags; # need this to be independent for forward vs reverse zones, as they're not merged 51 49 52 while (my ($revid,$revzone,$revstat,$changed,$defloc) = $revsth->fetchrow_array) { 50 53 my $cidr = NetAddr::IP->new($revzone); … … 101 104 $soasth->execute($revid); 102 105 my (@zsoa) = $soasth->fetchrow_array(); 103 printrec_bind(\%zonefiles, $zsoa[7], 'y', \@loclist, $revzone, 106 ##fixme: do we even need @loclist passed in? 107 printrec_bind(\%zonefiles, $zsoa[7], 'y', \%recflags, $revzone, 104 108 $zsoa[0],$zsoa[1],$zsoa[2],$zsoa[3],$zsoa[4],$zsoa[5],$zsoa[6],$zsoa[8],''); 105 109 … … 216 220 sub printrec_bind { 217 221 my $dnsdb = shift; 218 my ($zonefiles, $recid, $revrec, $loclist, $zone, $host, $type, $val, $distance, $weight, $port, $ttl, 222 223 # my ($zonefiles, $recid, $revrec, $loclist, $zone, $host, $type, $val, $distance, $weight, $port, $ttl, 224 my ($zonefiles, $recid, $revrec, $recflags, $zone, $host, $type, $val, $distance, $weight, $port, $ttl, 219 225 $loc, $stamp, $expires, $stampactive) = @_; 220 226 … … 335 341 $$recflags{$val}++; 336 342 if ($revrec eq 'y') { 337 printrec_bind($zonefiles, $recid, $revrec, $ loclist, $zone, $host, 12, $val, $distance, $weight, $port, $ttl,343 printrec_bind($zonefiles, $recid, $revrec, $recflags, $zone, $host, 12, $val, $distance, $weight, $port, $ttl, 338 344 $loc, $stamp, $expires, $stampactive); 339 345 #print {$zonefiles->{$loc}} "=$host:$val:$ttl:$stamp:$loc\n" or die $!; … … 343 349 # $loc, $stamp, $expires, $stampactive) = @_; 344 350 } else { 345 printrec_bind($zonefiles, $recid, $revrec, $ loclist, $zone, $host, 1, $val, $distance, $weight, $port, $ttl,351 printrec_bind($zonefiles, $recid, $revrec, $recflags, $zone, $host, 1, $val, $distance, $weight, $port, $ttl, 346 352 $loc, $stamp, $expires, $stampactive); 347 353 } … … 415 421 } # PTR template 416 422 423 elsif ($type == 65283) { # A+PTR template 424 $val = NetAddr::IP->new($val); 425 # Just In Case. An A+PTR should be impossible to add to a v6 revzone via API. 426 return if $val->{isv6}; 427 428 if ($val->masklen < 16) { 429 foreach my $sub ($val->split(16)) { 430 $self->__publish_subnet($sub, $recflags, $host, $zonefiles->{$loc}, $ttl, $stamp, $loc, $zone, 0); 431 } 432 } else { 433 $self->__publish_subnet($val, $recflags, $host, $zonefiles->{$loc}, $ttl, $stamp, $loc, $zone, 0); 434 } 435 } # A+PTR template 436 437 elsif ($type == 65284) { # AAAA+PTR template 438 # Stub for completeness. Could be exported to DNS software that supports 439 # some degree of internal automagic in generic-record-creation 440 # (eg http://search.cpan.org/dist/AllKnowingDNS/ ) 441 } # AAAA+PTR template 442 417 443 } # printrec_bind() 418 444
Note:
See TracChangeset
for help on using the changeset viewer.