From: Dirk Koopman Date: Thu, 23 Mar 2023 17:22:12 +0000 (+0000) Subject: allow /32 etc in is_ipaddr X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=dc9a699965ba5a2e347a72d4ba8b0612f8adc63e allow /32 etc in is_ipaddr --- diff --git a/cmd/show/badip.pl b/cmd/show/badip.pl index a92329c9..832c98cd 100644 --- a/cmd/show/badip.pl +++ b/cmd/show/badip.pl @@ -24,7 +24,7 @@ my $count = 0; if (@in) { foreach my $ip (@in) { if (DXCIDR::find($ip)) { - push @out, "$ip FOUND"; + push @out, "$ip DIRTY"; ++$count; } else { push @out, "$ip CLEAN"; diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 286f544b..d23c27cf 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -457,6 +457,7 @@ sub is_latlong # is it an ip address? sub is_ipaddr { + $_[0] =~ s|/\d+$||; if ($ptonok) { if ($_[0] =~ /:/) { if (inet_pton(AF_INET6, $_[0])) {