Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 99910 invoked from network); 16 Jul 2010 06:07:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Jul 2010 06:07:46 -0000 Received: (qmail 40762 invoked by uid 500); 16 Jul 2010 06:07:46 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 40662 invoked by uid 500); 16 Jul 2010 06:07:45 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 40653 invoked by uid 99); 16 Jul 2010 06:07:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jul 2010 06:07:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jul 2010 06:07:41 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o6G5xnGC028919 for ; Fri, 16 Jul 2010 05:59:49 GMT Message-ID: <26859163.410221279259989735.JavaMail.jira@thor> Date: Fri, 16 Jul 2010 01:59:49 -0400 (EDT) From: "Xiao Shu (JIRA)" To: commits@harmony.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 In-Reply-To: <1066453.410201279259751071.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ 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(""); > 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.