Changeset 59


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

/trunk/dnsbl

Polish CIDR autofinder to only get used on non-CIDR ranges; Postgres is

happy to take CIDR ranges.

Add missing IP highlight flag to DNSBLweb.pm

Location:
trunk/dnsbl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/DNSBLweb.pm

    r57 r59  
    8484      $iprow{ipcount} = $data4[1];
    8585      $iprow{indent} = '  'x$lvl;
     86      $iprow{repeater} = 1 if $ip eq $data4[0];
    8687#       ip        | count | s4list |             added
    8788      push @iprows, \%iprow;
  • trunk/dnsbl/dnsbl.cgi

    r55 r59  
    138138    }
    139139    if ($webvar{$blockn} =~ /-/) {
    140       $err .= "Autofinding CIDR block containing $webvar{ip} for range '$webvar{$blockn}': ";
    141       my ($s,$f) = split /[\s-]+/, $webvar{$blockn};
    142       my $cidr = $dnsbl->range2cidr($s, $f, $webvar{ip});
    143       $err .= "$cidr<br>\n";
    144       $webvar{$blockn} = $cidr;
     140      my $tmp = new NetAddr::IP $webvar{$blockn};
     141      if (!$tmp) {
     142        # Don't need to autofind ranges that are already CIDR-matched
     143        $err .= "Autofinding CIDR block containing $webvar{ip} for range '$webvar{$blockn}': ";
     144        my ($s,$f) = split /[\s-]+/, $webvar{$blockn};
     145        my $cidr = $dnsbl->range2cidr($s, $f, $webvar{ip});
     146        $err .= "$cidr<br>\n";
     147        $webvar{$blockn} = $cidr;
     148      }
    145149    }
    146150    if (!$dnsbl->blockexists($webvar{$blockn})) {
Note: See TracChangeset for help on using the changeset viewer.