On Thu, 21 Jul 2022 17:41:22 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:
>> src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c line 207: >> >>> 205: } >>> 206: } >>> 207: return JNI_TRUE; >> >> Hello Daniel, if I'm reading this diff correctly, then we have inverted the >> check on `fd`. So I suspect this final `return` now needs to be changed to >> `return JNI_FALSE` to account for `fd` being `-1`? > > Hi Jaikiran, the point of this change was to better support systems where > either IPv4 or IPv6 was disabled. I'm not sure if that can even happen on > Mac. > The change here is that if we can't create one socket, we don't immediately > return false, but instead return the result for the other socket. For > example, if creating IPv4 socket fails, we only check if DF is supported on > IPv6 socket, and return that as a result. If both `socket` calls fail, we > don't know if the DF flag is supported, and return true (before the patch we > would return false in that case). I can modify the patch to return false in > that case, or roll back this change entirely if you think it makes no sense. I think this change makes sense so long as we are sure that if IPv4 or IPv6 is disabled then the right call happens for the other option. ------------- PR: https://git.openjdk.org/jdk/pull/9575