harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Loenko" <mloe...@gmail.com>
Subject RE: svn commit: r412049 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
Date Tue, 06 Jun 2006 10:06:00 GMT
Hi George

Do you have a test that failed? It would be nice to add a regression test...

Thanks,
Mikhail


>-----Original Message-----
>To: harmony-commits@incubator.apache.org
>Subject: svn commit: r412049 -
>/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.jav
>a
>
>Author: gharley
>Date: Tue Jun  6 01:51:43 2006
>New Revision: 412049
>
>URL: http://svn.apache.org/viewvc?rev=412049&view=rev
>Log:
>Fixing NPE problem introduced in HARMONY-500 when machine has more
than one network interface.
>
>Modified:
>
>incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
>
>Modified:
>incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
>URL:
>http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/j
>ava/net/NetworkInterface.java?rev=412049&r1=412048&r2=412049&view=diff
>==============================================================================
>---
>incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
>(original)
>+++
>incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/NetworkInterface.java
>Tue Jun  6 01:51:43 2006
>@@ -298,15 +298,19 @@
>         }
>
>         for (NetworkInterface netif : interfaces) {
>-            for (InetAddress addr : netif.addresses) {
>-                if (16 == addr.ipaddress.length) {
>-                    if (addr.isLinkLocalAddress() ||
addr.isSiteLocalAddress()) {
>-                        ((Inet6Address) addr).scopedIf = netif;
>-                        ((Inet6Address) addr).ifname = netif.name;
>-                        ((Inet6Address) addr).scope_ifname_set = true;
>+            // Ensure that current NetworkInterface is bound to at least
>+            // one InetAddress before processing
>+            if (netif.addresses != null) {
>+                for (InetAddress addr : netif.addresses) {
>+                    if (16 == addr.ipaddress.length) {
>+                        if (addr.isLinkLocalAddress() ||
addr.isSiteLocalAddress()) {
>+                            ((Inet6Address) addr).scopedIf = netif;
>+                            ((Inet6Address) addr).ifname = netif.name;
>+                            ((Inet6Address) addr).scope_ifname_set = true;
>+                        }
>                     }
>                 }
>-            }
>+            }// end if
>         }
>
>         return (new Vector<NetworkInterface>(Arrays.asList(interfaces)))

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message