diff --git a/src/jdk.net/aix/native/libextnet/AIXSocketOptions.c b/src/jdk.net/aix/native/libextnet/AIXSocketOptions.c index 503f48be32e..cbee29855dc 100644 --- a/src/jdk.net/aix/native/libextnet/AIXSocketOptions.c +++ b/src/jdk.net/aix/native/libextnet/AIXSocketOptions.c @@ -86,7 +86,7 @@ JNIEXPORT void JNICALL Java_jdk_net_AIXSocketOptions_setQuickAck0 int optval; int rv; optval = (on ? 1 : 0); - rv = setsockopt(fd, SOL_SOCKET, TCP_NODELAYACK, &optval, sizeof (optval)); + rv = setsockopt(fd, IPPROTO_TCP, TCP_NODELAYACK, &optval, sizeof (optval)); handleError(env, rv, "set option TCP_NODELAYACK failed"); } @@ -99,7 +99,7 @@ JNIEXPORT jboolean JNICALL Java_jdk_net_AIXSocketOptions_getQuickAck0 (JNIEnv *env, jobject unused, jint fd) { int on; socklen_t sz = sizeof (on); - int rv = getsockopt(fd, SOL_SOCKET, TCP_NODELAYACK, &on, &sz); + int rv = getsockopt(fd, IPPROTO_TCP, TCP_NODELAYACK, &on, &sz); handleError(env, rv, "get option TCP_NODELAYACK failed"); return on != 0; } @@ -111,7 +111,7 @@ JNIEXPORT jboolean JNICALL Java_jdk_net_AIXSocketOptions_getQuickAck0 */ JNIEXPORT jboolean JNICALL Java_jdk_net_AIXSocketOptions_quickAckSupported0 (JNIEnv *env, jobject unused) { - return socketOptionSupported(SOL_SOCKET, TCP_NODELAYACK); + return socketOptionSupported(IPPROTO_TCP, TCP_NODELAYACK); } /* diff --git a/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c b/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c index 42fd240d9ac..5690daca773 100644 --- a/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c +++ b/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,7 @@ JNIEXPORT void JNICALL Java_jdk_net_LinuxSocketOptions_setQuickAck0 int optval; int rv; optval = (on ? 1 : 0); - rv = setsockopt(fd, SOL_SOCKET, TCP_QUICKACK, &optval, sizeof (optval)); + rv = setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &optval, sizeof (optval)); handleError(env, rv, "set option TCP_QUICKACK failed"); } @@ -102,7 +102,7 @@ JNIEXPORT jboolean JNICALL Java_jdk_net_LinuxSocketOptions_getQuickAck0 (JNIEnv *env, jobject unused, jint fd) { int on; socklen_t sz = sizeof (on); - int rv = getsockopt(fd, SOL_SOCKET, TCP_QUICKACK, &on, &sz); + int rv = getsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &on, &sz); handleError(env, rv, "get option TCP_QUICKACK failed"); return on != 0; } @@ -114,7 +114,7 @@ JNIEXPORT jboolean JNICALL Java_jdk_net_LinuxSocketOptions_getQuickAck0 */ JNIEXPORT jboolean JNICALL Java_jdk_net_LinuxSocketOptions_quickAckSupported0 (JNIEnv *env, jobject unused) { - return socketOptionSupported(SOL_SOCKET, TCP_QUICKACK); + return socketOptionSupported(IPPROTO_TCP, TCP_QUICKACK); } /*