harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao Shu (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-6588) [classlib][luni] InetAddress.isReachable(NetworkInterface netif,int ttl, int timeout) always return false when testing reachablity by sending TCP ECHO
Date Fri, 16 Jul 2010 05:59:49 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-6588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Xiao Shu updated HARMONY-6588:
------------------------------

    Attachment: Harmony-6588.diff

The root cause is in isReachableByMultiThread method of InetAddress.java,
while calling isReachableByTCP(addr, InetAddress.this,timeout), the source and dest address
arguments are in wrong order.
Thus, in the execution of isReachableByTCP method, NETIMPL.bind(fd, source, 0) is trying to
bind a remote address, whill will throw BindException.

The pacth contains the fix and unit test case.

> [classlib][luni] InetAddress.isReachable(NetworkInterface netif,int ttl, int timeout)
always return false when testing reachablity by sending TCP ECHO
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6588
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6588
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M14
>            Reporter: Xiao Shu
>         Attachments: Harmony-6588.diff
>
>
> Run below test case on Linux ppc with a user who's not administrator. (For Administrators,
will test reachability by sending ICMP ECHO REQUESTs )
> import java.net.*;
> import java.util.*;
> public class Reachability {
>     public static void main(String[] args) throws Exception {
>         InetAddress ia = InetAddress.getByName("<IP_ADDRESS>");
>         System.out.println("InetAddress: " + ia);
>         Enumeration nis = NetworkInterface.getNetworkInterfaces();
>         while (nis.hasMoreElements()) {
>             NetworkInterface ni = (NetworkInterface) nis.nextElement();
>             System.out.println("Network Interface: " + ni);
>             boolean reachable = ia.isReachable(ni, 10, 60000);
>             System.out.println(reachable);
>         }
>     }
> }
> The expected result is printing out at least one true.
> But when running this test case, it will print all false.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message