Skip to content

Clarify InetAddresses.forString() IPv4-mapped IPv6 behavior#8206

Open
bsaptarshi wants to merge 2 commits intogoogle:masterfrom
bsaptarshi:issue-8158-update-javadoc
Open

Clarify InetAddresses.forString() IPv4-mapped IPv6 behavior#8206
bsaptarshi wants to merge 2 commits intogoogle:masterfrom
bsaptarshi:issue-8158-update-javadoc

Conversation

@bsaptarshi
Copy link

Explicitly state in the Javadoc that IPv4-mapped IPv6 addresses (e.g., "::ffff:192.168.0.1") are returned as Inet4Address instances. This aligns with the behavior of java.net.InetAddress but is a common source of confusion for users expecting Inet6Address.

Fixes #8158

Explicitly state in the Javadoc that IPv4-mapped IPv6 addresses (e.g.,
"::ffff:192.168.0.1") are returned as Inet4Address instances. This
aligns with the behavior of java.net.InetAddress but is a common source
of confusion for users expecting Inet6Address.

Fixes google#8158
@google-cla
Copy link

google-cla bot commented Feb 11, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

forString() incorrectly parsing IPv4 mapped IPv6 address

1 participant