dut-xiayuan commented on a change in pull request #1177: [ISSUE #1057]Filter
out docker0 when finding a local address
URL: https://github.com/apache/rocketmq/pull/1177#discussion_r286930494
##########
File path:
remoting/src/main/java/org/apache/rocketmq/remoting/common/RemotingUtil.java
##########
@@ -99,6 +99,10 @@ public static String getLocalAddress() {
ArrayList<String> ipv6Result = new ArrayList<String>();
while (enumeration.hasMoreElements()) {
final NetworkInterface networkInterface =
enumeration.nextElement();
+ if ("docker0".equals(networkInterface.getName())) {
Review comment:
Hi, we can read the sysfs directory to check if the interface is a bridge.
This method is also used in some bridge tools, such as `brctl`, in fact, I was
inspired by this tool.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services