Changeset 683 for trunk/dns-rpc.cgi


Ignore:
Timestamp:
06/17/15 15:12:58 (10 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix semantic snafu in RPC handler's delByCIDR(); subsets of the passed
CIDR were being deleted when they shouldn't have been. Also separate
some code segments for reading clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r682 r683  
    841841  _commoncheck(\%args, 'y');
    842842
     843  # Caller may pass 'n' in delsubs.  Assume it should be false/undefined
     844  # unless the caller explicitly requested 'yes'
     845  $args{delsubs} = 0 if $args{delsubs} ne 'y';
     846
    843847  # much like addOrUpdateRevRec()
    844848  my $zonelist = $dnsdb->getZonesByCIDR(%args);
     
    852856    my $zone = new NetAddr::IP $zonelist->[0]->{revnet};
    853857    if ($zone->contains($cidr)) {
    854 
    855858      if ($args{delsubs}) {
    856859        # Delete ALL EVARYTHING!!one11!! in $args{cidr}
     
    879882      } else {
    880883        # Selectively delete only exact matches on $args{cidr}
    881 
    882884        # We need to strip the CIDR mask on IPv4 /32 assignments, or we can't find single-IP records
    883885        my $filt = ($cidr->{isv6} || $cidr->masklen != 32 ? "$cidr" : $cidr->addr);
Note: See TracChangeset for help on using the changeset viewer.