Skip Menu |

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

Report information
The Basics
Id: 49632
Status: resolved
Priority: 0/
Queue: Net-CIDR-Set

People
Owner: Nobody in particular
Requestors: mcrose [...] excel.net
Cc:
AdminCc:

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



Subject: as_string() bug
Date: Fri, 11 Sep 2009 12:39:24 -0500
To: <bug-Net-CIDR-Set [...] rt.cpan.org>
From: "Matt Rose" <mcrose [...] excel.net>
When trying to retrieve the results of a addition of the netblocks '10.200.3.0/24' and '10.200.4.0/24', I get incorrect netblocks from as_string(), but as_cidr() works properly. The following code reproduces the problem, using Net::Cidr::Set 0.11 on perl 5.10.0 and Fedora Core 10: #!/usr/bin/perl use Net::CIDR::Set; use 5.010; use strict; use warnings; use Data::Dumper; my $netblock_union = Net::CIDR::Set->new; for my $network (qw (10.200.3.0/24 10.200.4.0/24)) { $netblock_union->add($network); } say "As array:"; print Dumper $netblock_union->as_cidr_array(); say "As string:"; print Dumper $netblock_union->as_string(); And the output is: As array: $VAR1 = '10.200.3.0/24'; $VAR2 = '10.200.4.0/24'; As string: $VAR1 = '10.200.3.0/21';
From: os [...] uebertrieben.net
The attached patch seams to fix it. But I am sure that is is not really smart, maybe someone can use it to find the line with the bug and fix it even smarter :-D. On Fri Sep 11 13:40:00 2009, mcrose@excel.net wrote: Show quoted text
> When trying to retrieve the results of a addition of the netblocks > '10.200.3.0/24' and '10.200.4.0/24', I get incorrect netblocks from > as_string(), but as_cidr() works properly. The following code reproduces > the problem, using Net::Cidr::Set 0.11 on perl 5.10.0 and Fedora Core > 10: > > #!/usr/bin/perl > > use Net::CIDR::Set; > use 5.010; > use strict; > use warnings; > use Data::Dumper; > > my $netblock_union = Net::CIDR::Set->new; > for my $network (qw (10.200.3.0/24 10.200.4.0/24)) { > $netblock_union->add($network); > } > > say "As array:"; > print Dumper $netblock_union->as_cidr_array(); > say "As string:"; > print Dumper $netblock_union->as_string(); > > And the output is: > > As array: > $VAR1 = '10.200.3.0/24'; > $VAR2 = '10.200.4.0/24'; > As string: > $VAR1 = '10.200.3.0/21'; >
Subject: bugfixdiff
Download bugfixdiff
application/octet-stream 438b

Message body not shown because it is not plain text.

From: gottreu [...] gmail.com
I made a pull request on github at https://github.com/AndyA/Net--CIDR--Set Is that the appropriate action?
On Wed Jan 30 10:51:39 2013, gottreu@gmail.com wrote: Show quoted text
> I made a pull request on github at https://github.com/AndyA/Net--CIDR--Set > > Is that the appropriate action?
Yes it was! Sorry it took so long to respond. 0.13 is on its way to CPAN now. Thanks.