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

Handle IPv4 mapped addresses; Detect IPv6 addresses at Installation #1110

Closed
robocoder opened this issue Jan 14, 2010 · 3 comments
Closed

Handle IPv4 mapped addresses; Detect IPv6 addresses at Installation #1110

robocoder opened this issue Jan 14, 2010 · 3 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@robocoder
Copy link
Contributor

core/Common.php getIp() uses ip2long(). This only works for ipv4 addresses.

ipv6 addresses result in 0 (and are converted back as "0.0.0.0").

@robocoder
Copy link
Contributor Author

Unit tests should ensure these formats are handled:

  • 2001:0db8:85a3:0000:0000:8a2e:0370:7334
  • 2001:db8:85a3:0:0:8a2e:370:7334 (leading zeros omitted)
  • 2001:db8:85a3::8a2e:370:7334 (groups of zeros omitted)
  • ::ffff:c000:280 and ::ffff:192.0.2.128(double quad notation for ipv4 mapped addresses)

@robocoder
Copy link
Contributor Author

MySQL bigint is 8 bytes and won't accommodate a 128 bit ipv6 address. So... we'll defer comment:2 for post-1.0.

The current proposal is:

  • Installation: detect ipv6 REMOTE_ADDR and warn
  • core/Common.php: getIp() - accept IPv4-mapped addresses prefixed by ::ffff:

@robocoder
Copy link
Contributor Author

(In [1790]) fixes #1110 - warn if IPv6 address detected during Installation; handle IPv4 mapped addresses

@robocoder robocoder added this to the Piwik 0.5.5 milestone Jul 8, 2014
@robocoder robocoder mentioned this issue May 4, 2011
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

1 participant