-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
NetUtil.bytesToIpAddress broken for IPv4 #5821
Labels
Comments
@henrik-lindqvist maybe you can provide a PR ? |
or provide a link to an RFC or specification which describes expected behavior and an input which doesn't produce the expected output. |
NetUtil.bytesToIpAddress(new byte[] { 83, -1, -20, 16 }, 0, 4) returns "0.255.255.16" not "83.255.236.16" as expected. See initial post for cause. |
Scottmitch
added a commit
to Scottmitch/netty
that referenced
this issue
Sep 22, 2016
Motivation: NetUtil.bytesToIpAddress does not correctly translate IPv4 address to String. Also IPv6 addresses may not follow minimization conventions when converting to a String (see rfc 5952). Modifications: - NetUtil.bytesToIpAddress should correctly handle negative byte values for IPv4 - NetUtil.bytesToIpAddress should leverage existing to string conversion code in NetUtil Result: Fixes netty#5821
liuzhengyang
pushed a commit
to liuzhengyang/netty
that referenced
this issue
Sep 10, 2017
Motivation: NetUtil.bytesToIpAddress does not correctly translate IPv4 address to String. Also IPv6 addresses may not follow minimization conventions when converting to a String (see rfc 5952). Modifications: - NetUtil.bytesToIpAddress should correctly handle negative byte values for IPv4 - NetUtil.bytesToIpAddress should leverage existing to string conversion code in NetUtil Result: Fixes netty#5821
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For textual IPv4 representation the method incorrectly performs bit shifts on the array bytes.
4.1.5.Final
The text was updated successfully, but these errors were encountered: