Github user maoling commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/533#discussion_r194247586
--- Diff:
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -222,15 +222,15 @@ static public InitialMessage parse(Long
protocolVersion, DataInputStream din)
num_read, remaining, sid);
}
- // FIXME: IPv6 is not supported. Using something like Guava's
HostAndPort
- // parser would be good.
String addr = new String(b);
- String[] host_port = addr.split(":");
-
- if (host_port.length != 2) {
- throw new InitialMessageException("Badly formed address:
%s", addr);
+ int pos = addr.lastIndexOf(":");
+
--- End diff --
- look at this
[SO](https://stackoverflow.com/questions/2345063/java-common-way-to-validate-and-convert-hostport-to-inetsocketaddress),I'm
afraid something like `[2001:db8:85a3::8a2e:370:7334]:80` will fail
- I will test this patch in the real IPv6 production ENV in case of
something I miss.
---