HDFS-17629. The IP address is incorrectly displayed in the IPv6 environment.#8419
Open
balodesecurity wants to merge 1 commit intoapache:trunkfrom
Open
HDFS-17629. The IP address is incorrectly displayed in the IPv6 environment.#8419balodesecurity wants to merge 1 commit intoapache:trunkfrom
balodesecurity wants to merge 1 commit intoapache:trunkfrom
Conversation
…onment.
In histogram-hostip.js, open_hostip_list() extracted the host from
dn.infoAddr using split(":")[0], which returns only the first
colon-delimited segment. For an IPv6 infoAddr of the form
[2001:db8::1]:9864 that yields "[2001" instead of the full address.
Fix: mirror the logic already used in dfshealth.js — split on "]:"
first; if the result has more than one part the address is IPv6 and
we strip the leading "[" from part[0]; otherwise fall back to the
original IPv4 split(":")[0] path.
|
🎊 +1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
histogram-hostip.js,open_hostip_list()extracted the host fromdn.infoAddrusingsplit(":")[0]. For an IPv6infoAddrof the form[2001:db8::1]:9864this yields[2001instead of the full IPv6 address.dfshealth.js: split on]:first; if more than one part the address is IPv6 and we strip the leading[from part[0]; otherwise fall back to the original IPv4split(":")[0]path.Test
host:port) continues to extract the host, and IPv6 ([addr]:port) now correctly extracts the full address without brackets.