Skip to content

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

Open
bsaptarshi wants to merge 1 commit intogoogle:masterfrom
bsaptarshi:issue-8158-update-javadoc
Open

Clarify InetAddresses.forString() IPv4-mapped IPv6 behavior#8206
bsaptarshi wants to merge 1 commit 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

@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.

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
@bsaptarshi bsaptarshi force-pushed the issue-8158-update-javadoc branch from 290afe0 to 8c87722 Compare February 14, 2026 02:34
@bsaptarshi
Copy link
Author

bsaptarshi commented Feb 14, 2026

Hi @cpovirk , checking in to see if someone might have a moment to review this Javadoc clarification for issue #8158. TY!

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