[Openvpn-devel,v4] Reenable xmit_hold when using p2p tcp-server and tls-server

Message ID 20260810114212.28379-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v4] Reenable xmit_hold when using p2p tcp-server and tls-server |

Commit Message

Gert Doering Aug. 10, 2026, 11:42 a.m. UTC
  From: Arne Schwabe <arne@rfc2549.org>

Commit 619c3e9 changed the logic to enable xmit_hold only
when c->mode is CM_CHILD_TCP. This works for --mode server and
was probably done to allow to properly work when the server
is listening on multiple sockets and options->ce.proto cannot be used
to determine if this socket is tcp or udp.

Restore the logic for p2p to avoid both sides starting sending
resets at the same time.

Closes: openvpn/openvpn#1089
Change-Id: I728067ef08481c87c7b6918c88ebcaeeec466534
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: MaxF <max@max-fillinger.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1837
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1837
This mail reflects revision 4 of this Change.

Acked-by according to Gerrit (reflected above):
MaxF <max@max-fillinger.net>
  

Comments

Gert Doering Aug. 10, 2026, 12:26 p.m. UTC | #1
Good find :-) - going back to the 2.6 source, this is "sort of obviously
correct" (2.6 checked for ce.proto == TCP_SERVER, which does no longer
make sense with the multisocket patch in 2.7 - which got it right for a
"p2mp --server" with a TCP socket, but the "p2p --tcp-server" case got
lost)

For a normal client or server setup this does not change anything, just
for "p2p --tcp-server".  The t_server tests test that, as did MaxF's
test setup which led to GH issue 1089.  And indeed, maybe I should
setup a "p2p --tcp-server --tls-crypt-v2" instance... :-)

Your patch has been applied to the master and release/2.7 branch (bugfix).

commit 603aa9698c140d15b7464af8fb83bd2aa71da680 (master)
commit c26995bf68984be140714754520c3848b8d9bcf9 (release/2.7)
Author: Arne Schwabe
Date:   Mon Aug 10 13:42:06 2026 +0200

     Reenable xmit_hold when using p2p tcp-server and tls-server

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: MaxF <max@max-fillinger.net>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1837
     Message-Id: <20260810114212.28379-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg38265.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 69d226d..08278fc2 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -3332,7 +3332,7 @@ 
 
     /* should we not xmit any packets until we get an initial
      * response from client? */
-    if (to.server && c->mode == CM_CHILD_TCP)
+    if (to.server && (c->mode == CM_CHILD_TCP || (c->mode == CM_P2P && options->ce.proto == PROTO_TCP_SERVER)))
     {
         to.xmit_hold = true;
     }