From dc9a699965ba5a2e347a72d4ba8b0612f8adc63e Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Thu, 23 Mar 2023 17:22:12 +0000 Subject: [PATCH] allow /32 etc in is_ipaddr --- cmd/show/badip.pl | 2 +- perl/DXUtil.pm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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])) { -- 2.34.1