This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit cb65f9d02602766a5da1c0d87aa130a5b913a236
Author: Serris Lew <[email protected]>
AuthorDate: Mon Jul 15 13:24:44 2024 -0700

    Try TCP_FASTOPEN socket option with mptcp (#11517)
    
    * Try TCP_FASTOPEN socket option with mptcp
    
    * Add comment for EOPNOTSUPP
    
    ---------
    
    Co-authored-by: Serris Lew <[email protected]>
    (cherry picked from commit 90ab13277f4afb198494ce48799c5bb1be910beb)
---
 doc/admin-guide/files/records.yaml.en.rst |  4 ++--
 src/iocore/net/Connection.cc              | 11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/doc/admin-guide/files/records.yaml.en.rst 
b/doc/admin-guide/files/records.yaml.en.rst
index 19d6dbd144..944a255b43 100644
--- a/doc/admin-guide/files/records.yaml.en.rst
+++ b/doc/admin-guide/files/records.yaml.en.rst
@@ -5088,8 +5088,8 @@ Sockets
         TCP_NOTSENT_LOWAT (64)
         INCOMING_CPU (128)
 
-   Note: If MPTCP is enabled, TCP_NODELAY is only supported on Linux kernels 
5.17+. TCP_FASTOPEN
-   and TCP_NOTSENT_LOWAT socket options are currently not supported.
+   Note: If MPTCP is enabled, TCP_NODELAY is only supported on Linux kernels 
5.17+ and TCP_FASTOPEN is
+   only supported on Linux kernels 6.2+. TCP_NOTSENT_LOWAT socket option is 
currently not supported.
 
 .. note::
 
diff --git a/src/iocore/net/Connection.cc b/src/iocore/net/Connection.cc
index d13e1a7254..80276efdd9 100644
--- a/src/iocore/net/Connection.cc
+++ b/src/iocore/net/Connection.cc
@@ -272,10 +272,13 @@ Server::setup_fd_for_listen(bool non_blocking, const 
NetProcessor::AcceptOptions
 
 #ifdef TCP_FASTOPEN
   if (opt.sockopt_flags & NetVCOptions::SOCK_OPT_TCP_FAST_OPEN) {
-    if (opt.f_mptcp) {
-      Warning("[Server::listen] TCP_FASTOPEN socket option not valid on MPTCP 
socket level");
-    } else if (safe_setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, (char 
*)&opt.tfo_queue_length, sizeof(int))) {
-      goto Lerror;
+    if (safe_setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, (char 
*)&opt.tfo_queue_length, sizeof(int))) {
+      // EOPNOTSUPP also checked for general safeguarding of unsupported 
operations of socket functions
+      if (opt.f_mptcp && (errno == ENOPROTOOPT || errno == EOPNOTSUPP)) {
+        Warning("[Server::listen] TCP_FASTOPEN socket option not valid on 
MPTCP socket level");
+      } else {
+        goto Lerror;
+      }
     }
   }
 #endif

Reply via email to