Open fishnux opened 4 years ago
yes, I'm encountering the same issue. I'm feeding the tree IPV4 CIDRs only and when I ask on an IPv6 - it finds it in the tree. Can we please have a fix for it?
I did some simplification works on branch in my fork - replacing current implementation for IPv4 with IPv6-mapped addresses.
The only problem for some of you can be performance - simple IPv4 Find (e.g. t.FindCIDR("73.26.28.24")
in tree with 1 million of /24
entries) takes 200ns/op instead of 36ns/op.
When I'll find again some free time I'll try to look into it - I used net
package for IPv4 parsing and it is a lot slower than custom made bit mangling, of course :)
There seems to be a collision with the following specific CIDRs:
https://play.golang.org/p/xQiaBZQZkWi