Changeset 37 for trunk


Ignore:
Timestamp:
11/23/11 15:44:55 (13 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Forgot to update the actual data-export lines when I added the
extra layers of bitmasking. rbldnsd does not like eg
"127.0.0.1050" as an IP to return...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/export-dnsbl

    r34 r37  
    6060  # more or less raw CIDR block-and-IP info.  rbldnsd format for convenience.
    6161  foreach (sort ipcmp keys %iplist) {
    62     my $out = "$_:127.0.0.$iplist{$_}:".
     62    my $entry;
     63    if ($iplist{$_} > 256) {
     64      if ($iplist{$_} > 65536) {
     65        $entry .= int($iplist{$_}/65536).".";
     66        $iplist{$_} = $iplist{$_} % 65536;
     67      } else {
     68        $entry .= "0.";
     69      }
     70      $entry .= int($iplist{$_}/256).".";
     71      $iplist{$_} = $iplist{$_} % 256;
     72    } else {
     73      $entry .= "0.0.";
     74    }
     75    $entry .= $iplist{$_};
     76    my $out = "$_:127.$entry:".
    6377        ($iplist{$_} & 2 ?
    6478                ($config{iplisted} ? $config{iplisted} : '$ relayed a reported spam') :
     
    7084} else {
    7185  foreach (sort ipcmp keys %iplist) {
     86    my $entry;
     87    if ($iplist{$_} > 256) {
     88      if ($iplist{$_} > 65536) {
     89        $entry .= int($iplist{$_}/65536).".";
     90        $iplist{$_} = $iplist{$_} % 65536;
     91      } else {
     92        $entry .= "0.";
     93      }
     94      $entry .= int($iplist{$_}/256).".";
     95      $iplist{$_} = $iplist{$_} % 256;
     96    } else {
     97      $entry .= "0.0.";
     98    }
     99    $entry .= $iplist{$_};
    72100    my ($o1,$o2,$o3,$o4) = (/^(\d+)\.([\d*]+)(?:\.([\d*]+)(?:\.([\d*]+))?)?$/);
    73101    print "+".(defined($o4) ? "$o4." : '').(defined($o3) ? "$o3." : '').(defined($o2) ? "$o2." : '').
    74         "$o1.spamhosts.company.com:127.0.0.$iplist{$_}:900:::\n";
     102        "$o1.spamhosts.company.com:127.0.0.$entry:900:::\n";
    75103  }
    76104}
Note: See TracChangeset for help on using the changeset viewer.