kezhuw commented on code in PR #2280: URL: https://github.com/apache/zookeeper/pull/2280#discussion_r2259425175
########## zookeeper-server/src/main/java/org/apache/zookeeper/server/auth/IPAuthenticationProvider.java: ########## @@ -81,6 +96,132 @@ private byte[] v4addr2Bytes(String addr) { return b; } + /** + * Validates an IPv6 address string and converts it into a byte array. + * + * @param ipv6Addr The IPv6 address string to validate. + * @return A byte array representing the IPv6 address if valid, or null if the address + * is invalid or cannot be parsed. + */ + public static byte[] v6addr2Bytes(String ipv6Addr) { + if (ipv6Addr == null || ipv6Addr.trim().isEmpty()) { + LOG.info("Input IPv6 address cannot be null or empty."); + return null; + } Review Comment: ```suggestion ``` This matches `v4addr2Bytes`. -- 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: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org