New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: ParseIP for IPv6 with embedded IPv4 incorrect parsing #26694
Comments
Yes, it is parsed correctly. What you get is the hexadecimal representation of the mixed address. In an IPv6 address you got 8 groups consisting of 16 bit each. In a IPv4 address are 4 groups consisting of 8 bits each. So your IPv4 will be represented in hexadecimal as 0x0d01 (= 13.1) and 0x4403 (= 68.3). |
@ajwsh Thank for a answer!
|
It sounds like things are working correctly. We don't use the issue tracker for questions; please see https://golang.org/wiki/Questions . Thanks. (I don't know the answer to your question myself.) |
In general, it's better to refer to the latest addressing architecture, RFC 4291, instead of RFC 3513. RFC 4291 holds better descriptions on the section "IPv6 Addresses with Embedded IPv4 Addresses", and has a reference to RFC 4038 (Application Aspects of IPv6 Transition). So taking a look at https://tools.ietf.org/html/rfc4291 will probably answer your question. |
Hi, I got a strange result when do parsing IPv6:IPv4 (mixed-form), no by rfc3513
0:0:0:0:0:0:13.1.68.3 -> ::d01:4403
https://play.golang.org/p/mPH9cANDRVO
Is it real correct parsing?
The text was updated successfully, but these errors were encountered: