diff options
author | jfrijters <jfrijters> | 2011-01-06 20:04:58 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-01-06 20:04:58 +0300 |
commit | 97b392cf0992bbee591fa7e17770badb141b8643 (patch) | |
tree | 3aaa216ccf78f7022a412d9640b7d1efe4175859 /openjdk | |
parent | ec3c81d4081aa9607ea8037693e31b20ab9eaf95 (diff) |
Unspecified scope id should be -1 in Java, not 0.
Diffstat (limited to 'openjdk')
-rw-r--r-- | openjdk/java/net/TwoStacksPlainSocketImpl_c.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openjdk/java/net/TwoStacksPlainSocketImpl_c.java b/openjdk/java/net/TwoStacksPlainSocketImpl_c.java index 4764acfc..38235264 100644 --- a/openjdk/java/net/TwoStacksPlainSocketImpl_c.java +++ b/openjdk/java/net/TwoStacksPlainSocketImpl_c.java @@ -710,7 +710,9 @@ static void socketAccept(JNIEnv env, TwoStacksPlainSocketImpl _this, SocketImpl } else { /* AF_INET6 -> Inet6Address */ - socketAddressObj = new Inet6Address(null, him.him6.sin6_addr, him.him6.sin6_scope_id); + // [IKVM] We need to convert scope_id 0 to -1 here, because for sin6_scope_id 0 means unspecified, whereas Java uses -1 + int scopeId = him.him6.sin6_scope_id; + socketAddressObj = new Inet6Address(null, him.him6.sin6_addr, scopeId == 0 ? -1 : scopeId); } /* fields common to AF_INET and AF_INET6 */ |