Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java and python implementations from maxmind are very different #39

Closed

Conversation

nickjacob
Copy link

yes.. to be fair the java & python implementation of this are more legit:

https://github.com/maxmind/MaxMind-DB-Reader-python/blob/main/maxminddb/reader.py#L128

(java the same).

I don't feel like it's fair to actually upstream this.. unless I implemented it that way & added tests. See https://maxmind.github.io/MaxMind-DB/#ipv4-addresses-in-an-ipv6-tree this spec sounds more like what locus did.. but what maxmind does is what the writer does.. so...

tested this on a few DBs that our code created & it's the same each time. Maybe I need to implement the offset thing.

With this patch/version.. we can produce a hybrid ipv4 & ipv6 DB from one input file from IP2location

@nickjacob nickjacob closed this Feb 6, 2024
@g-andrade
Copy link
Owner

Hi,

I haven’t looked at the IPv4 root node computation in such a long time that it’s almost like someone else’s code to me at this point!

From what I can gather out of your PR, the spec says one thing but implementations out there (official ones) sometimes (always?) do another. Are the two compatible by chance? I haven’t encountered any issues with this but I’ve only used MaxMind databases so far.

Thanks for the heads up, ping me again if a fix is needed.

@nickjacob
Copy link
Author

nickjacob commented Feb 6, 2024 via email

@sneako sneako deleted the nick/eng-1128-ipv6-geodb branch February 7, 2024 09:26
g-andrade added a commit that referenced this pull request May 4, 2024
---
Fix wrong root in MMDB tree parser, which failed IPv4 lookups in IPv6
databases that don't include IPv4-mapped IPv6 addresses.

A bug that was part of locus since forever but didn't show up in MaxMind
databases since those appear to always include the IPv4-mapped IPv6
addresses node.

Thanks to https://github.com/nickjacob who left me the clues I needed in
an earlier closed PR:
* #39
@g-andrade
Copy link
Owner

There was indeed an issue with the IPv4 root node, #44, which I ran into when testing IPinfo databases.

Fixed in 75e38f3, release 2.3.8 (pushed to Hex).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants