-
Bug
-
Resolution: Fixed
-
P4
-
11, 17
-
b01
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8334368 | 11.0.25 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
In
http://hg.openjdk.java.net/jdk/jdk/file/64ca9fbcf85f/src/java.base/unix/native/libnet/Inet6AddressImpl.c#l172
if ((*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID)) {
That is `InetAddress.preferIPv6Address` is used as a boolean, but
http://hg.openjdk.java.net/jdk/jdk/file/64ca9fbcf85f/src/java.base/share/classes/java/net/InetAddress.java#l216
/* Specify address family preference */
static transient final int preferIPv6Address;
That is, it is an `int`. (In JDK-8 it was a `boolean`.)
I don't know how `GetStaticBoolean` deals with a mismatch in types. The result will be interpreted by the `C` 0-or-not-0 test. I don't know if that is what is needed here.
(Note that this is inside a `#if defined(MACOSX)` block.)
http://hg.openjdk.java.net/jdk/jdk/file/64ca9fbcf85f/src/java.base/unix/native/libnet/Inet6AddressImpl.c#l172
if ((*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID)) {
That is `InetAddress.preferIPv6Address` is used as a boolean, but
http://hg.openjdk.java.net/jdk/jdk/file/64ca9fbcf85f/src/java.base/share/classes/java/net/InetAddress.java#l216
/* Specify address family preference */
static transient final int preferIPv6Address;
That is, it is an `int`. (In JDK-8 it was a `boolean`.)
I don't know how `GetStaticBoolean` deals with a mismatch in types. The result will be interpreted by the `C` 0-or-not-0 test. I don't know if that is what is needed here.
(Note that this is inside a `#if defined(MACOSX)` block.)
- backported by
-
JDK-8334368 [17u] Inet6AddressImpl.c: `lookupIfLocalHost` accesses `int InetAddress.preferIPv6Address` as a boolean
- Resolved
- duplicates
-
JDK-8244202 Implementation of JEP 418: Internet-Address Resolution SPI
- Resolved
- relates to
-
JDK-8016521 InetAddress should not always re-order addresses returned from name service
- Closed
- links to
-
Commit openjdk/jdk11u-dev/667bbd3f
-
Commit openjdk/jdk17u-dev/3eb15b02
-
Review openjdk/jdk11u-dev/2769
-
Review openjdk/jdk17u-dev/2048
(2 links to)