Skip to content

Use IPv4 mask for IPv4-compatible and IPv4-mapped IPv6 addresses

Latest
Compare
Choose a tag to compare
@nicolaschan nicolaschan released this 05 Jun 03:12
· 2 commits to master since this release
a383ba3

No changes in the public API, but the anonymization of IPv4-compatible and IPv4-mapped IPv6 addresses has changed to use the IPv4 mask on the IPv4 part.

If an address is of the form x:x:x:x:x:x:d.d.d.d and begins with 96 zeros or 80 zeros + 16 ones, then the actual mask used is 96 + the IPv4 mask. Previously, the IPv6 mask was used for all cases in this form.

The new behavior for this case is:

anonymize('::ffff:123.123.123.123') // -> '::ffff:123.123.123.0'
anonymize('::123.123.123.0') // -> '::123.123.123.0'
  • Resolves issue #2