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

IPParser doesn't handle IPv4-Mapped IPv6 Address #14

Open
brbaker opened this issue Jun 12, 2015 · 4 comments
Open

IPParser doesn't handle IPv4-Mapped IPv6 Address #14

brbaker opened this issue Jun 12, 2015 · 4 comments

Comments

@brbaker
Copy link

brbaker commented Jun 12, 2015

The code doesn't properly handle IPv4 addresses that are mapped into the IPv6 address space.
http://tools.ietf.org/html/rfc4291#section-2.5.5.2

Code currently passes off to the IPv4 parser when it finds a '.', however the IPv4 parser doesn't handle it. Probably best to extract the IPv4 mapped address and then pass it into the ipv4 parser.

@rajeshsegu
Copy link
Contributor

@brbaker I have a pull request pending usage of 'ip-address' module. I think this handles all the IPv4 mapped types. I would like you to review and see if this fits the bill and we can make the switch easily going forward.

ip-address: https://www.npmjs.com/package/ip-address

Pull Request: #17

@jtpio
Copy link

jtpio commented Aug 28, 2015

I'm having the same problem.
Just to be sure, I took the latest version to include the pull request #17. But the issue still seems to be present.
When testing with '::ffff:192.168.0.1', the Error 'Invalid IPv4 address' is thrown.
Breaking this down, I found that the ip-address module doesn't validate the address as a proper IPv4 address (here)

ipv4

What would be best way to tackle this problem?
Manually extracting the IPv4 address before sending it to getGeoData, as @brbaker suggested?

@akoskm
Copy link

akoskm commented Sep 15, 2015

Same issue. Error: Invalid IPv4 address is thrown for ::ffff:127.0.0.1.

@knoxcard
Copy link

knoxcard commented Dec 28, 2018

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

No branches or pull requests

5 participants