You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "stoty (via GitHub)" <gi...@apache.org> on 2025/09/02 07:49:03 UTC
Re: [PR] HBASE-28973 Enable HBase RegionServers and Masters to support IPv6 IP addresses as server identity when USEIP is enabled [hbase]
stoty commented on code in PR #6456:
URL: https://github.com/apache/hbase/pull/6456#discussion_r2315223761
##########
hbase-common/src/main/java/org/apache/hadoop/hbase/ServerName.java:
##########
@@ -356,13 +359,14 @@ public static ServerName parseServerName(final String str) {
* Checks if the provided server address is formatted as an IPv6 address. This method uses Java's
* InetAddress to parse the input and confirms if the address is an instance of Inet6Address for
* robust validation instead of relying on string splitting.
- * @param serverAddress The address string to validate (can be a hostname or IP)
+ * @param serverAddress The address string to validate
* @return true if the address is a valid IPv6 address; false otherwise.
*/
public static boolean isIpv6ServerName(String serverAddress) {
try {
InetAddress address = InetAddress.getByName(serverAddress);
- return address instanceof Inet6Address;
+ return address instanceof Inet6Address && !address.getHostName().equals(serverAddress)
Review Comment:
`!address.getHostName().equals(serverAddress)`
This excludes the cases when the canonical IPv6 address format is supplied.
Why would we want to do that ?
The colon check looks good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org