]> dxcluster.org Git - spider.git/commitdiff
allow /32 etc in is_ipaddr
authorDirk Koopman <djk@tobit.co.uk>
Thu, 23 Mar 2023 17:22:12 +0000 (17:22 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Thu, 23 Mar 2023 17:22:12 +0000 (17:22 +0000)
cmd/show/badip.pl
perl/DXUtil.pm

index a92329c9fde1d1c4ed350ef23fe9619b01493e2b..832c98cdc470027c7194573dcf40655034b3638d 100644 (file)
@@ -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";
index 286f544b1bc017c00d612df26a927f893a85338b..d23c27cfa5e3d73e4d3c21fae04aef16d6d08a9e 100644 (file)
@@ -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])) {