Changeset 3 for trunk/dnsbl/DNSBL.pm
- Timestamp:
- 09/09/09 15:18:13 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dnsbl/DNSBL.pm
r2 r3 297 297 $level--; 298 298 299 # need this for a bunch of things, may as well do it here 300 my ($masklen) = ($container =~ m|/(\d+)$|); 301 299 302 # Snag all parent block "is-it-listed?" data, and stuff it into a single 300 303 # variable we can use later. Much faster than retrieving this data 301 304 # individually, for each octet iteration. 302 305 306 my $mycount = 0; 303 307 my $sql = "SELECT count(i.ip),b.block,b.level,b.listme AS oobblock,o.listme AS ooborg ". 304 308 "FROM iplist i INNER JOIN blocks b ON i.ip << b.block INNER JOIN orgs o ON b.orgid = o.orgid ". 305 309 "WHERE b.block >>= ? ". 306 310 "GROUP BY b.block,b.level,b.listme,o.listme ORDER BY b.block"; 307 308 311 my $parsth = $dbh->prepare($sql); 309 312 $parsth->execute($container); … … 314 317 $pdata |= $bitfields{block} if $pblock; 315 318 $pdata |= $bitfields{org} if $porg; 316 } 317 318 if ($mode eq 'cidr') { 319 $listhosts->{$container} |= $pdata if $pdata; 319 $mycount = $pcount if $p eq $container; 320 } 321 322 if ($mode eq 'cidr' || $mode eq 'rbldnsd') { 323 $listhosts->{$container} |= $pdata if $pdata && ($ooborg || $oobblock || ($mycount >= $autolist{$masklen})); 320 324 } else { 321 322 325 # if $cidr->masklen is <= 24, iterate on /24 boundaries for bulk sublisting 323 326 # if $cidr->masklen is <= 16, iterate on /16 boundaries for bulk sublisting 324 327 # if $cidr->masklen is <= 8, iterate on /8 boundaries for bulk sublisting 325 328 326 my ($masklen) = ($container =~ m|/(\d+)$|);327 329 if ($pdata) { 328 330 my @blocksubs;
Note:
See TracChangeset
for help on using the changeset viewer.