You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2023/01/10 15:34:09 UTC
[GitHub] [rocketmq] ShadowySpirits commented on a diff in pull request #5856: [ISSUE #5740] Fix util.getIP sometimes choose localhost over LAN ip.
ShadowySpirits commented on code in PR #5856:
URL: https://github.com/apache/rocketmq/pull/5856#discussion_r1065930787
##########
common/src/main/java/org/apache/rocketmq/common/UtilAll.java:
##########
@@ -604,7 +606,7 @@ public static byte[] getIP() {
if (ipCheck(ipByte)) {
if (!isInternalIP(ipByte)) {
return ipByte;
- } else if (internalIP == null) {
+ } else if (internalIP == null || internalIP[0] == (byte) 127) {
Review Comment:
This judgment changes the behavior of the getIP function. If we only have lo interface, getIP will throw RuntimeException.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org