Open Bug 441768 Opened 16 years ago Updated 2 years ago

PR_NetAddrToString() renders IPv4-mapped IPv6 addresses incorrectly

Categories

(NSPR :: NSPR, defect)

x86
macOS
defect

Tracking

(Not tracked)

People

(Reporter: alex, Unassigned)

References

Details

The getnameinfo()-backed PR_NetAddrToString() implementation renders IPv4-mapped IPv6 addresses and IPv4-compatible addresses incorrectly as IPv4 addresses.

E.g. "::ffff:192.168.1.1" or "::192.168.1.1" are both rendered as "192.168.1.1".

The V6AddrToString()-backed version of PR_NetAddrToString(), on the other hand, renders the addresses as expected in IPv6 presentation format.

The problem here seems to be the behavior of getnameinfo: 
"If the socket address structure contains an IPv4-mapped IPv6 address or an IPv4-compatible IPv6 address, the implementation shall extract the embedded IPv4 address and lookup the node name for that IPv4 address."

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: wtc → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.