Code Review Request: 7084032: test/java/net/Inet6Address/B6558853.java fails on Windows XP/2003 if IPv6 enabled (original) (raw)

Kurchi Hazra kurchi.subhra.hazra at oracle.com
Thu Sep 1 08:13:32 PDT 2011


Hi,

test/java/net/Inet6Address/B6558853.java tests if the address obtained from getHostAddress() on connections using IPv6 link-local addresses contains the zone id. For Inet6Address.getHostAddress() to return the zone id, Inet6Address.scope_id_set needs to be set to true in addition to setting the appropriate Inet6Address.scope_id. In case of Windows XP/2003 with IPv6 enabled, the native socket implementation of socketAccept() method in src/windows/native/java/net/TwoStacksPlainSocketImpl.c does not set the scope_id_set to true which causes the zone id not to be returned, and B6558853 throws a RuntimeException.

The fix is to simply set the scopeidsetID in socketAccept() method to true if the scope_id is greater than 0.

Submitting hg diff:

diff --git a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c b/src/windows/native/java/net/TwoStacksPlainSocketImpl.c --- a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c +++ b/src/windows/native/java/net/TwoStacksPlainSocketImpl.c @@ -576,6 +576,7 @@ Java_java_net_TwoStacksPlainSocketImpl_s { /* fields on this */ jint port;

Thanks,

-- -Kurchi



More information about the net-dev mailing list