dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] zonghaishang commented on a change in pull request #2079: [Dubbo-2064] Ipv6 support
Date Wed, 01 Aug 2018 02:44:08 GMT
zonghaishang commented on a change in pull request #2079: [Dubbo-2064] Ipv6 support
URL: https://github.com/apache/incubator-dubbo/pull/2079#discussion_r206740993
 
 

 ##########
 File path: dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
 ##########
 @@ -194,26 +194,22 @@ private static InetAddress getLocalAddress0() {
         }
         try {
             Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
-            if (interfaces != null) {
-                while (interfaces.hasMoreElements()) {
-                    try {
-                        NetworkInterface network = interfaces.nextElement();
-                        Enumeration<InetAddress> addresses = network.getInetAddresses();
-                        if (addresses != null) {
-                            while (addresses.hasMoreElements()) {
-                                try {
-                                    InetAddress address = addresses.nextElement();
-                                    if (isValidAddress(address)) {
-                                        return address;
-                                    }
-                                } catch (Throwable e) {
-                                    logger.warn(e);
-                                }
+            while (interfaces.hasMoreElements()) {
 
 Review comment:
   ```
       public static Enumeration<NetworkInterface> getNetworkInterfaces()
           throws SocketException {
           final NetworkInterface[] netifs = getAll();
   
           // specified to return null if no network interfaces
           if (netifs == null)
               return null;
   ```
   
   Should check the interfaces property  null value

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Mime
View raw message