mjschultz / py-radix

Python radix tree implementation for IPv4 and IPv6 prefix matching.
Other
119 stars 37 forks source link

search_covered issue #26

Closed Edsall closed 8 years ago

Edsall commented 8 years ago

I am running with 0.9.4

When I do the following, I expect the result to be empty. Instead, I get node '10.30.2.1/32'.

r = radix.Radix() r.add('10.30.2.1/32') r.add('10.30.2.1/25') result = r.search_covered('10.30.2.64/32')

If the last byte of the search address is less than 0x40, it seems to work.

sorc1 commented 8 years ago

I've created pull request 27 that fixes the issue. Please test it.

Edsall commented 8 years ago

That seems to have fixed it.

Thanks.

mjschultz commented 8 years ago

Thanks @sorc1 for the fix and @Edsall for the bug report!

The fix should now be available via pip install py-radix==0.9.5