Changeset 607


Ignore:
Timestamp:
04/03/14 17:51:40 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix very subtle bug in converting IP values to .arpa "hostnames" for
reverse zone display; NetAddr::IP converts:

knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa

to 192.168.7.6/32. O_o Really.

Since .arpa "hostnames" in reverse zones don't need to be converted to
.arpa "hostnames", we'll just skip them all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r606 r607  
    37473747  while (my $rec = $recsth->fetchrow_hashref) {
    37483748    if ($args{revrec} eq 'y' && $args{defrec} eq 'n' &&
    3749         ($self->{showrev_arpa} eq 'record' || $self->{showrev_arpa} eq 'all') ) {
     3749        ($self->{showrev_arpa} eq 'record' || $self->{showrev_arpa} eq 'all') &&
     3750        $rec->{val} !~ /\.arpa$/ ) {
     3751      # note we're sneakily skipping all reverse zone .arpa "hostnames" on the excuse
     3752      # that this fragment won't do anything anyway.  however:
     3753      # knurd.5.0.0.0.b.0.0.b.5.b.0.b.f.e.e.b.d.a.e.d.ip6.arpa -> 192.168.7.6/32
     3754      # when fed to NetAddr::IP.  O_o  (At least 4.058, .062, and .071, on CentOS 5 and Debian wheezy and sid)
    37503755##enhance:  extend {showrev_arpa} eq 'record' to specify record types
    3751       my $tmp = new NetAddr::IP $rec->{val};
    3752       $rec->{val} = DNSDB::_ZONE($tmp, 'ZONE', 'r', '.').($tmp->{isv6} ? '.ip6.arpa' : '.in-addr.arpa');
     3756      my $tmpip = new NetAddr::IP $rec->{val};
     3757      $rec->{val} = DNSDB::_ZONE($tmpip, 'ZONE', 'r', '.').($tmpip->{isv6} ? '.ip6.arpa' : '.in-addr.arpa') if $tmpip;
    37533758    }
    37543759    push @working, $rec;
Note: See TracChangeset for help on using the changeset viewer.