Code Review 6947677: InetAddress.isReachable() throws "java.net.SocketException:Invalid argument" on Linux if run as root

Alan Bateman Alan.Bateman at oracle.com
Thu Oct 21 09:11:19 PDT 2010


Chris Hegarty wrote:
>
> :
> I did think about this, but the local interface addresses are 
> reachable, isReachable returns true, even if the lookback interface is 
> specified. We'd have to maintain a list of "reachable" addresses. 
> Which I didn't think would be an nicer solution.
I would think that all non-local interfaces should be non-reachable (I 
wasn't suggesting keeping a list).

>
>
> I've removed the extra code and made the change simpler.
>   http://cr.openjdk.java.net/~chegar/6947677/webrev.01/webrev/
It's okay with me although I guess it could be "if (errno != EINVAL)"  
(to avoid the empty statement).

-Alan.



More information about the net-dev mailing list