Skip to content

forString() incorrectly parsing IPv4 mapped IPv6 address #8158

@wdec

Description

@wdec

Guava Version

33.1.2

Description

When parsing an IPv4 mapped IPv6 address the InetAddresses.forString() incorrectly returns the address as a v4 address.

Example

String ::ffff:10.111.184.37 -> Inet4Address "/10.111.184.37"

Expected Behavior

The address should be returned as a v6 address.

Actual Behavior

Returned as an IPv4 object

Packages

com.google.common.net

Platforms

No response

Checklist

  • I agree to follow the code of conduct.

  • I can reproduce the bug with the latest version of Guava available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions