Skip Menu |

This queue is for tickets about the NetAddr-IP CPAN distribution.

Report information
The Basics
Id: 62521
Status: resolved
Worked: 10 min
Priority: 0/
Queue: NetAddr-IP

People
Owner: Nobody in particular
Requestors: shuff [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 4.034
Fixed in: 4.033



Subject: 4.034 breaks SpamAssassin
After upgrading from NetAddr-IP 4.033 to 4.034, SpamAssassin 3.3.1 fails to start. Here's a sample of the errors: Oct 28 10:31:34 mail-1 spamd[8077]: netset: cannot include 0:0:0:0:0:0:0:1/128 as it has already been included Oct 28 10:31:35 mail-1 spamd[8077]: netset: cannot include 0:0:0:0:0:0:0:1/128 as it has already been included Oct 28 10:31:35 mail-1 spamd[8080]: netset: cannot include <network1>/24 as it has already been included Oct 28 10:31:35 mail-1 spamd[8080]: netset: cannot include <network2>/24 as it has already been included Oct 28 10:31:35 mail-1 spamd[8080]: netset: cannot include <host1>/32 as it has already been included Oct 28 10:31:35 mail-1 spamd[8080]: netset: cannot include <host2>/32 as it has already been included it looks like Mark Martinec has found a test that zeroes in on the breakage: http://permalink.gmane.org/gmane.mail.spam.spamassassin.general/131120 correct (NetAddr-IP-4.033): $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.0.0.0/8")' 0:0:0:0:0:0:7F00:0/104 wrong (NetAddr-IP-4.034): $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.0.0.0/8")' 0:0:0:0:0:0:7F00:0/8 I can confirm that downgrading to 4.033 eliminates the problem. -Steve -- Steve Huff (SHUFF) * shuff@cpan.org
On Thu Oct 28 11:19:07 2010, SHUFF wrote: Show quoted text
> > it looks like Mark Martinec has found a test that zeroes in on the > breakage: > > http://permalink.gmane.org/gmane.mail.spam.spamassassin.general/131120 > > correct (NetAddr-IP-4.033): > $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.0.0.0/8")' > 0:0:0:0:0:0:7F00:0/104 > > wrong (NetAddr-IP-4.034): > $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.0.0.0/8")' > 0:0:0:0:0:0:7F00:0/8
Attached is an implementation of this test case. -Steve -- Steve Huff (SHUFF) * shuff@cpan.org
Subject: v4-to-v6_test.patch
diff -Naur NetAddr-IP-4.034-orig/t/v4-to-v6.t NetAddr-IP-4.034/t/v4-to-v6.t --- NetAddr-IP-4.034-orig/t/v4-to-v6.t 1969-12-31 19:00:00.000000000 -0500 +++ NetAddr-IP-4.034/t/v4-to-v6.t 2010-10-28 11:57:29.000000000 -0400 @@ -0,0 +1,16 @@ +use Test::More tests => 2; + +use_ok('NetAddr::IP'); + +my $masks = { + 8 => 104, +}; + + +# test localhost +foreach my $mask ( sort( keys( %{$masks} ) ) ) { + + my $ip = NetAddr::IP->new6("127.0.0.0/$mask"); + my $target = '0:0:0:0:0:0:7F00:0/' . $masks->{$mask}; + ok( $ip eq $target, 'v4 to v6 netmask' ); +}
fixed in release 4.035
Subject: 4.034 breaks SpamAssassin NOT completely fixed in 4.035
From: tlhackque [...] yahoo.com
On Thu Oct 28 19:41:16 2010, MIKER wrote: Show quoted text
> fixed in release 4.035
Apparently not. See http://www.gossamer-threads.com/lists/spamassassin/users/157383 Short form: NetAddr::IP 4.035: correct, this case is now fixed: $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.0.0.0/8")' 0:0:0:0:0:0:7F00:0/104 still incorrect: $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127/8")' 0:0:0:0:0:0:7F00:0/8
From: paul [...] city-fan.org
On Mon Nov 01 10:23:38 2010, tlhackque wrote: Show quoted text
> On Thu Oct 28 19:41:16 2010, MIKER wrote:
> > fixed in release 4.035
> > Apparently not. > > See http://www.gossamer-threads.com/lists/spamassassin/users/157383 > > Short form: > > NetAddr::IP 4.035: > > correct, this case is now fixed: > $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.0.0.0/8")' > 0:0:0:0:0:0:7F00:0/104 > > still incorrect: > $ perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127/8")' > 0:0:0:0:0:0:7F00:0/8
Attached patch works for me and adds test case.
Subject: NetAddr-IP-4.035-RT62521.patch
diff -up NetAddr-IP-4.035/Lite/Lite.pm.orig NetAddr-IP-4.035/Lite/Lite.pm --- NetAddr-IP-4.035/Lite/Lite.pm.orig 2010-11-02 10:46:29.642163120 +0000 +++ NetAddr-IP-4.035/Lite/Lite.pm 2010-11-02 10:59:54.746161443 +0000 @@ -740,7 +740,7 @@ sub _xnew($$;$$) { if ($mval == 128) { # cidr 128 $mask = Ones; } - elsif ($ip =~ /^\d+\.\d+\.\d+\.\d+$/) { # corner case of ipV4 with new6 + elsif (index($ip,':') < 0) { # corner case of ipV4 with new6 $mask = shiftleft(Ones,32 -$mval); } elsif ($mask < 128) { # small cidr diff -up NetAddr-IP-4.035/Lite/t/bug62521.t.orig NetAddr-IP-4.035/Lite/t/bug62521.t --- NetAddr-IP-4.035/Lite/t/bug62521.t.orig 2010-10-28 22:25:20.000000000 +0100 +++ NetAddr-IP-4.035/Lite/t/bug62521.t 2010-11-02 10:53:04.666124405 +0000 @@ -1,5 +1,5 @@ -BEGIN { $| = 1; print "1..2\n"; } +BEGIN { $| = 1; print "1..3\n"; } END {print "not ok 1\n" unless $loaded;} $loaded = 1; @@ -21,3 +21,7 @@ my $ip = new6 NetAddr::IP::Lite('127.0.0 print "exp $exp\ngot ", $ip, "\nnot " unless $ip eq $exp; &ok; +$ip = new6 NetAddr::IP::Lite('127/8'); +print "exp $exp\ngot ", $ip, "\nnot " + unless $ip eq $exp; +&ok;
Subject: 4.034/5 breaks SpamAssassin
From: tlhackque [...] yahoo.com
Have reverted to earlier version to keep the mail flowing; can't test proposed patch at present. But it seems to me that the tests should also include the cousin cases: perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.255/16")' perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.255.255/24")' and perhaps some non-octet aligned lengths...e.g. perl -le 'use NetAddr::IP; print NetAddr::IP->new6("127.255.254/23")' Thanks for the efforts.
resolved in v4.036