Skip Menu |

This queue is for tickets about the Net-CIDR-Lite CPAN distribution.

Report information
The Basics
Id: 100887
Status: rejected
Priority: 0/
Queue: Net-CIDR-Lite

People
Owner: Nobody in particular
Requestors: stephen [...] bee.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Incomplete range compaction
Date: Fri, 12 Dec 2014 14:25:11 -0500
To: bug-Net-CIDR-Lite [...] rt.cpan.org
From: Stephen Cristol <stephen [...] bee.net>
Problem: Net::CIDR::Lite is not compacting a range as expected. =========================================== Code: #!/usr/bin/perl use 5.010; use Net::CIDR::Lite; my $cidr = Net::CIDR::Lite->new(); $cidr->add( '185.58.116.0/22' ); $cidr->add( '185.58.120.0/23' ); $cidr->add( '185.58.122.0/24' ); $cidr->add( '185.58.123.0/24' ); my $cidr_list = $cidr->list(); say join "\n", @$cidr_list; =========================================== Output: 185.58.116.0/22 185.58.120.0/22 Expected output: 185.58.116.0/21 =========================================== Environment: CentOS 6.6 (Linux 2.6.32-504.1.3.el6.i686) perl 5.12.4 perl-Net-CIDR-Lite-0.21 (from perl-Net-CIDR.noarch 0.13-1.el6.rf)
No, '116' is: 000000000000000001110100 Notice that the 4 bit is set. You can't mask to '/21' and be correct. If this was 16,20,22,23 you would be correct, but it is 116,120,122,123.