-
Notifications
You must be signed in to change notification settings - Fork 7
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
Parsing IPv4 mapped IPv6 not supported #13
Comments
@lpellegr |
Thanks for your answer.
I would say the result type has no real importance as long as we have a way to move from a representation to the other: i.e. to the IPv6 representation from the IPv4 one, and vice-versa. To make the intent very clear, an utility class could perhaps be introduced. In that case, at least 3 public methods would be needed:
@maltalex What do you think? |
Yeah, I've encountered Returning an IPv6Address does indeed sound more reasonable to me, but I'm not sure about the utility class. We could add a method to IPv6Address to return the lower 32 bits as an IPv4Address as well as a |
Yes, this looks great. The utility class was more an internal matter to keep features and purpose isolated. New methods in IPAddress classes could then rely on the utility class. It would be useful to have also a method in IPv4Address to create an IPv4 mapped IPv6Address. I am not sure whether parsing should be done in the existing method or a new one. I would say in a dedicated one as the existing method to parse IPv6 addresses looks quite optimized. @maltalex You maybe have a preference? |
Nice idea.
Ah, yes. I remember that method :) |
It seems that IPv4 mapped IPv6 addresses such as
::FFFF:83.90.47.30
is not supported:It throws the following error:
Is there any plan to support such IP addresses and conversion to IPv4?
The text was updated successfully, but these errors were encountered: