]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix FreeBSD-DCO and Multisocket interaction
authorGianmarco De Gregori <gianmarco@mandelbit.com>
Wed, 2 Apr 2025 13:21:42 +0000 (15:21 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 2 Apr 2025 18:22:50 +0000 (20:22 +0200)
FreeBSD-DCO does not support TCP as transport protocol so in order to
be able to use DCO in a multi-socket environment we need to check the
local_list entries and disable DCO if any of the listening socket
is TCP.

While at it, removed some dead code left from Multisocket polishing.

Github: closes OpenVPN/openvpn#710

Change-Id: I9b6359076a61ae2bbb8e5cea00e33969cb5f92cf
Signed-off-by: Gianmarco De Gregori <gianmarco@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250402132148.18810-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31324.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/dco.c
src/openvpn/options.c
src/openvpn/options.h

index d00958da2bdb0db808f131b36991d9c82d86cac4..7ad9cb33a76a406edc9894d9c5eaf40e48216af3 100644 (file)
@@ -260,10 +260,16 @@ dco_check_option_ce(const struct connection_entry *ce, int msglevel, int mode)
     }
 
 #if defined(TARGET_FREEBSD)
-    if (!proto_is_udp(ce->proto))
+    if (ce->local_list)
     {
-        msg(msglevel, "NOTE: TCP transport disables data channel offload on FreeBSD.");
-        return false;
+        for (int i = 0; i < ce->local_list->len; i++)
+        {
+            if (!proto_is_dgram(ce->local_list->array[i]->proto))
+            {
+                msg(msglevel, "NOTE: TCP transport disables data channel offload on FreeBSD.");
+                return false;
+            }
+        }
     }
 #endif
 
index 99dd60ab2e1d3e217bb963d6efd669649b2156d9..6605a42bce1e5e66e16cb1b692dc5eec4fba27fb 100644 (file)
@@ -9577,20 +9577,3 @@ has_udp_in_local_list(const struct options *options)
 
     return false;
 }
-
-bool
-has_tcp_in_local_list(const struct options *options)
-{
-    if (options->ce.local_list)
-    {
-        for (int i = 0; i < options->ce.local_list->len; i++)
-        {
-            if (!proto_is_dgram(options->ce.local_list->array[i]->proto))
-            {
-                return true;
-            }
-        }
-    }
-
-    return false;
-}
index fa617c8f2ed9210b399538219eb9319666ae6c97..8d1ef6c347518dcbeb21d7b299526442fa851273 100644 (file)
@@ -921,8 +921,6 @@ bool key_is_external(const struct options *options);
 
 bool has_udp_in_local_list(const struct options *options);
 
-bool has_tcp_in_local_list(const struct options *options);
-
 /**
  * Returns whether the current configuration has dco enabled.
  */