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
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1262
Download (untitled) / with headers
text/plain 1.2k
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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: multipart/mixed; boundary="----------=_1288287644-2361-183"
Message-ID: <rt-3.8.HEAD-2361-1288287644-1203.62521-0-0 [...] rt.cpan.org>
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 563
Download (untitled) / with headers
text/plain 563b
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
MIME-Version: 1.0
Subject: v4-to-v6_test.patch
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: application/octet-stream; name="v4-to-v6_test.patch"
Content-Disposition: inline; filename="v4-to-v6_test.patch"
Content-Transfer-Encoding: base64
Content-Length: 565
Download v4-to-v6_test.patch
text/x-diff 565b
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' ); +}
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2362-1288309276-1383.62521-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 23
fixed in release 4.035
MIME-Version: 1.0
Subject: 4.034 breaks SpamAssassin NOT completely fixed in 4.035
In-Reply-To: <rt-3.8.HEAD-2362-1288309276-1383.62521-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.8.HEAD-2362-1288309276-1383.62521-0-0 [...] rt.cpan.org>
Message-ID: <rt-3.8.HEAD-2360-1288621417-6.62521-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: binary
From: tlhackque [...] yahoo.com
X-RT-Original-Encoding: utf-8
Content-Length: 424
Download (untitled) / with headers
text/plain 424b
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
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-2360-1288621417-6.62521-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
References: <rt-3.8.HEAD-2362-1288309276-1383.62521-0-0 [...] rt.cpan.org> <rt-3.8.HEAD-2360-1288621417-6.62521-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1288696511-2361-232"
Message-ID: <rt-3.8.HEAD-2361-1288696511-3.62521-0-0 [...] rt.cpan.org>
From: paul [...] city-fan.org
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 552
Download (untitled) / with headers
text/plain 552b
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.
MIME-Version: 1.0
Subject: NetAddr-IP-4.035-RT62521.patch
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: application/octet-stream; name="NetAddr-IP-4.035-RT62521.patch"
Content-Disposition: inline; filename="NetAddr-IP-4.035-RT62521.patch"
Content-Transfer-Encoding: base64
Content-Length: 1152
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;
MIME-Version: 1.0
Subject: 4.034/5 breaks SpamAssassin
In-Reply-To: <rt-3.8.HEAD-2361-1288696511-3.62521-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.8.HEAD-2362-1288309276-1383.62521-0-0 [...] rt.cpan.org> <rt-3.8.HEAD-2360-1288621417-6.62521-0-0 [...] rt.cpan.org> <rt-3.8.HEAD-2361-1288696511-3.62521-0-0 [...] rt.cpan.org>
Message-ID: <rt-3.8.HEAD-2362-1288735760-1580.62521-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: binary
From: tlhackque [...] yahoo.com
X-RT-Original-Encoding: utf-8
Content-Length: 457
Download (untitled) / with headers
text/plain 457b
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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2363-1289955161-315.62521-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 18
resolved in v4.036


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.