We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 403e127 commit 02840e8Copy full SHA for 02840e8
dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
@@ -544,6 +544,7 @@ public static NetworkInterface findNetworkInterface() {
544
}
545
546
547
+
548
if (result == null) { // If not found, try to get the first one
549
for (NetworkInterface networkInterface : validNetworkInterfaces) {
550
Enumeration<InetAddress> addresses = networkInterface.getInetAddresses();
@@ -552,7 +553,11 @@ public static NetworkInterface findNetworkInterface() {
552
553
if (addressOp.isPresent()) {
554
try {
555
if (addressOp.get().isReachable(100)) {
- return networkInterface;
556
+ if (addressOp.get().isSiteLocalAddress()) {
557
+ return networkInterface;
558
+ } else {
559
+ result = networkInterface;
560
+ }
561
562
} catch (IOException e) {
563
// ignore
0 commit comments