RFR: JDK-8320168: handle setsocktopt return values
Matthias Baesken
mbaesken at openjdk.org
Thu Nov 16 13:16:32 UTC 2023
On Thu, 16 Nov 2023 09:01:02 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> There are a few places in the JDK C coding where the setsocktopt return value is not handled but better should be handled.
>
> src/java.base/unix/native/libnet/SdpSupport.c line 100:
>
>> 98: if (getsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&arg, &len) == 0) {
>> 99: res = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*)&arg, len);
>> 100: if (res < 0) JNU_ThrowIOExceptionWithLastError(env, "setsockopt SO_REUSEADDR");
>
> OFED deprecated SDP a long time and I think we should just remove this code from the JDK. The copying of the socket options was always a best effort basis. It requires Infiniband config to be able to test these changes so maybe it would be better to just drop it from this change as it can't be tested.
Hi Alan, do you mean "drop this chunk from the change" or "drop the coding that is trying to copy the socket options" ?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16684#discussion_r1395674845
More information about the nio-dev
mailing list