kalayciburak commented on code in PR #3291:
URL: https://github.com/apache/hugegraph/pull/3291#discussion_r4223199714


##########
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/util/IpUtil.java:
##########
@@ -63,8 +70,21 @@ private static List<String> getIpAddress() throws 
SocketException {
      */
     public static String getNearestAddress(String raftAddress) {
         try {
-            List<String> ipv4s = getIpAddress();
             String[] tmp = raftAddress.split(":");
+            if (!isDottedIpv4(tmp[0])) {
+                return raftAddress;
+            }
+
+            // A configured literal that is bound locally stays, including
+            // loopback. The default raft address is 127.0.0.1 and the
+            // partition engine uses that same value as its PeerId.
+            // Loopback is dropped only from fallback candidates, when the
+            // configured IPv4 is not local.
+            if (getIpAddress(true).contains(tmp[0])) {

Review Comment:
   fixed, pushed. getIpAddress now keeps link-local addresses for the 
bound-address check and filters link-local plus loopback only from fallback 
candidates. Added a regression test for a bound link-local address.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to