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