2. Add CTY-3308 prefixes.
3. Fix gen_usdb_data.pl (add missing use DXUtil), update current location of
official FCC databases.
+4. Remove the duplicate IP addresses across exits and relays from badip lists
+ during generation by create_master_badip_files.pl.
14Feb23=======================================================================
1. Attempt to be more M$ Windows compatible. This basically is to do with the
unfortunate fact that most of the Windows perl cannot do, or simulate
my $seen = str2time($e->{last_seen});
next unless $seen >= $now - $last_seen_window;
- my @or = clean_addr(@{$e->{or_addresses}}) if exists $e->{or_addresses};
my @exit = clean_addr(@{$e->{exit_addresses}}) if exists $e->{exit_addresses} ;
+ my @or = clean_addr(@{$e->{or_addresses}}) if exists $e->{or_addresses};
my $ors = join ', ', @or;
my $es = join ', ', @exit;
dbg "$0: $e->{nickname} $e->{last_seen} relays: [$ors] exits: [$es]" if $debug;
- for (@or) {
+ for (@exit) {
if (is_ipaddr($_)) {
- print RELAY "$_\n";
- ++$rcount;
+ print EXIT "$_\n";
+ ++$ecount;
} else {
print STDERR "$_\n";
++$error;
}
}
- for (@exit) {
+ for (@or) {
if (is_ipaddr($_)) {
- print EXIT "$_\n";
- ++$ecount;
+ print RELAY "$_\n";
+ ++$rcount;
} else {
print STDERR "$_\n";
++$error;
exit $error;
+my %addr;
+
sub clean_addr
{
my @out;
foreach (@_) {
my ($ipv4) = /^((?:\d+\.){3}\d+)/;
if ($ipv4) {
+ next if exists $addr{$ipv4};
push @out, $ipv4;
+ $addr{$ipv4}++;
next;
}
my ($ipv6) = /^\[([:a-f\d]+)\]/;
- push @out, $ipv6 if $ipv6;
+ if ($ipv6) {
+ next if exists $addr{$ipv6};
+ push @out, $ipv6;
+ $addr{$ipv6}++;
+ }
}
return @out;
}