Subject: | Invalid range calculation for some IPv4 IPs (but fine for others) |
I'm seeing some IPs turn into nonsense instead of a /32 when added.
e.g.:
[davidp@supernova:~/tmp]$ cat testcase
#!/usr/bin/env perl
use strict;
use Net::CIDR::Compare;
my $ip = shift || die "usage: $0 ip";
my $collection = Net::CIDR::Compare->new( print_errors => 1 );
my $list = $collection->new_list();
$collection->add_range($list, $ip);
$collection->process_intersection(expand_cidr => 8);
while (my $cidr_range = $collection->get_next_intersection_range()) {
print "range: $cidr_range\n";
}
[davidp@supernova:~/tmp]$ perl testcase 83.170.75.28
range: 83.170.75.28/32
[davidp@supernova:~/tmp]$ perl testcase 216.185.103.182
range: 1099511627736.185.103.182/32
Am I doing something silly, or is this tickling an odd bug?
Is this module maintained any more?