Skip Menu |

This queue is for tickets about the Net-IPAddress-Filter CPAN distribution.

Report information
The Basics
Id: 91861
Status: resolved
Priority: 0/
Queue: Net-IPAddress-Filter

People
Owner: DAVEWEBB [...] cpan.org
Requestors: david.orr [...] bizowie.com
Cc:
AdminCc:

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



Subject: Calls to in_filter fail
Date: Sat, 4 Jan 2014 17:42:52 -0500
To: bug-Net-IPAddress-Filter [...] rt.cpan.org
From: David Orr <david.orr [...] bizowie.com>
All calls to in_filter fail with the message "Intervals must have positive width at [...]Net/IPAddress/Filter.pm line 56". Since v0.08 of Set::IntervalTree, passing in a point ($pt, $pt as the range) to any of: insert remove remove_window fetch fetch_window results in the error "Intervals must have positive width" According to the bugs page for Set::IntervalTree, using points as ranges in the underlying implementation causes unexpected behavior: Unfortunately, the underlying C++ algorithm (which I did not write) was originally designed to work on both-ends-open intervals, and doesn't support zero-length intervals (well, it accepts them but then returns incorrect results). (https://rt.cpan.org/Public/Bug/Display.html?id=91238) In this case, because IP addresses are discrete and the filter uses half-open intervals, it *should* be a simple fix, passing in $test_num, $test_num + 1 instead of $test_num, $test_num. Thanks, David Orr
On Sat Jan 04 17:43:03 2014, david.orr@bizowie.com wrote: Show quoted text
> All calls to in_filter fail with the message "Intervals must have positive > width at [...]Net/IPAddress/Filter.pm line 56". > > Since v0.08 of Set::IntervalTree, passing in a point ($pt, $pt as the > range) to any of: > insert > remove > remove_window > fetch > fetch_window > results in the error "Intervals must have positive width" > > According to the bugs page for Set::IntervalTree, using points as ranges in > the underlying implementation causes unexpected behavior: > Unfortunately, the underlying C++ algorithm (which I did not write) was > originally designed to work on both-ends-open intervals, and doesn't > support zero-length intervals (well, it accepts them but then returns > incorrect results). > (https://rt.cpan.org/Public/Bug/Display.html?id=91238) > > In this case, because IP addresses are discrete and the filter uses > half-open intervals, it *should* be a simple fix, passing in > $test_num, $test_num + 1 > instead of > $test_num, $test_num. > > Thanks, > David Orr
Hi David, I'm looking at this today - all my testing was done with the, then current, 0.4. Cheers, Dave
On Mon Jan 06 04:05:32 2014, DAVEWEBB wrote: Show quoted text
> On Sat Jan 04 17:43:03 2014, david.orr@bizowie.com wrote:
> > All calls to in_filter fail with the message "Intervals must have > > positive > > width at [...]Net/IPAddress/Filter.pm line 56". > > > > Since v0.08 of Set::IntervalTree, passing in a point ($pt, $pt as the > > range) to any of: > > insert > > remove > > remove_window > > fetch > > fetch_window > > results in the error "Intervals must have positive width" > > > > According to the bugs page for Set::IntervalTree, using points as > > ranges in > > the underlying implementation causes unexpected behavior: > > Unfortunately, the underlying C++ algorithm (which I did not write) > > was > > originally designed to work on both-ends-open intervals, and doesn't > > support zero-length intervals (well, it accepts them but then returns > > incorrect results). > > (https://rt.cpan.org/Public/Bug/Display.html?id=91238) > > > > In this case, because IP addresses are discrete and the filter uses > > half-open intervals, it *should* be a simple fix, passing in > > $test_num, $test_num + 1 > > instead of > > $test_num, $test_num. > > > > Thanks, > > David Orr
> > Hi David, > > I'm looking at this today - all my testing was done with the, then > current, 0.4. > > Cheers, > > Dave
Sorry for the delay, but PAUSE was down, and I couldn't upload until today. I've just uploaded version 20140113 to CPAN, which should fix the behaviour for newer versions of Set::IntervalTree, and still be backwards compatible. I've tested with version 0.04 and 0.09 of Set::IntervalTree. Please let me know if there are still any errors. Dave
On Mon Jan 13 05:40:20 2014, DAVEWEBB wrote: Show quoted text
> On Mon Jan 06 04:05:32 2014, DAVEWEBB wrote:
> > On Sat Jan 04 17:43:03 2014, david.orr@bizowie.com wrote:
> > > All calls to in_filter fail with the message "Intervals must have > > > positive > > > width at [...]Net/IPAddress/Filter.pm line 56". > > > > > > Since v0.08 of Set::IntervalTree, passing in a point ($pt, $pt as > > > the > > > range) to any of: > > > insert > > > remove > > > remove_window > > > fetch > > > fetch_window > > > results in the error "Intervals must have positive width" > > > > > > According to the bugs page for Set::IntervalTree, using points as > > > ranges in > > > the underlying implementation causes unexpected behavior: > > > Unfortunately, the underlying C++ algorithm (which I did not write) > > > was > > > originally designed to work on both-ends-open intervals, and > > > doesn't > > > support zero-length intervals (well, it accepts them but then > > > returns > > > incorrect results). > > > (https://rt.cpan.org/Public/Bug/Display.html?id=91238) > > > > > > In this case, because IP addresses are discrete and the filter uses > > > half-open intervals, it *should* be a simple fix, passing in > > > $test_num, $test_num + 1 > > > instead of > > > $test_num, $test_num. > > > > > > Thanks, > > > David Orr
> > > > Hi David, > > > > I'm looking at this today - all my testing was done with the, then > > current, 0.4. > > > > Cheers, > > > > Dave
> > Sorry for the delay, but PAUSE was down, and I couldn't upload until > today. > > I've just uploaded version 20140113 to CPAN, which should fix the > behaviour for newer versions of Set::IntervalTree, and still be > backwards compatible. I've tested with version 0.04 and 0.09 of > Set::IntervalTree. > > > Please let me know if there are still any errors. > > Dave
Sourcecode is at https://github.com/d5ve/p5-Net-IPAddress-Filter if it's not showing on CPAN yet.