Skip to contentSkip to conversation

sockets: Remove the limitation of --tcp-nodelay to be server-only

PATCH In review David Sommerseth 2 participants 3 messages Dec 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sockets: Remove the limitation of --tcp-nodelay to be server-only

From: David Sommerseth <[email protected]...>

The assert(0) happening if trying to use --tcp-nodelay in a client config is really not helpful at all. When this assert(0) was removed, another warning appeared that this could only be used in server configs. That itself is also quite silly, as clients can choose to use --socket-flags TCP_NODELAY in the client config instead. This behaviour does not help the user in any way.

This patch removes the server-only restriction and rather provides a more helpful warning when using --tcp-nodelay on the client side.

Trac: 489

---
 src/openvpn/helper.c  | 2 +-
 src/openvpn/options.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
src/openvpn/helper.c +1 -1
index 0ed0b2b..339e2ae 100644
@@ -534,7 +534,7 @@ helper_tcp_nodelay (struct options *o)
 	}
       else
 	{
-	  ASSERT (0);
+	  o->sockflags |= SF_TCP_NODELAY;
 	}
     }
 #endif
src/openvpn/options.c +3 -1
index 721b42e..f0091c2 100644
@@ -2111,7 +2111,9 @@ options_postprocess_verify_ce (const struct options *options, const struct conne
       if (options->ssl_flags & SSLF_OPT_VERIFY)
 	msg (M_USAGE, "--opt-verify requires --mode server");
       if (options->server_flags & SF_TCP_NODELAY_HELPER)
-	msg (M_USAGE, "--tcp-nodelay requires --mode server");
+	msg (M_WARN, "WARNING: setting tcp-nodelay on the client side will not "
+             "affect the server. To have TCP_NODELAY in both direction use "
+             "tcp-nodelay in the server configuration instead.");
       if (options->auth_user_pass_verify_script)
 	msg (M_USAGE, "--auth-user-pass-verify requires --mode server");
 #if PORT_SHARE
Signature · 1 line
1.8.3.1
#1 lore raw

Am 09.12.14 10:52, schrieb David Sommerseth:

Quoted 9 lines

From: David Sommerseth <[email protected]...>

The assert(0) happening if trying to use --tcp-nodelay in a client config is really not helpful at all. When this assert(0) was removed, another warning appeared that this could only be used in server configs. That itself is also quite silly, as clients can choose to use --socket-flags TCP_NODELAY in the client config instead. This behaviour does not help the user in any way.

Quoted 5 lines

This patch removes the server-only restriction and rather provides a more helpful warning when using --tcp-nodelay on the client side.

Trac: 489

ACK. As already discussed on #openvpn :)

Arne

#2 lore raw
In reply to David Sommerseth

From: David Sommerseth <[email protected]...>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your patch has been applied to the master and release/2.3 branches.

commit 706283d3765d1ee62dbd913fbfc191855b92528d (master) commit 333566fd9d1951be97397f5f19d8bc78fb025af9 (release/2.3)

Author: David Sommerseth
Date:   Tue Dec 9 10:52:44 2014 +0100
     sockets: Remove the limitation of --tcp-nodelay to be server-only

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: [email protected]...
     URL: http://article.gmane.org/gmane.network.openvpn.devel/9334

- --
kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlSGyE8ACgkQDC186MBRfrrnDQCfSoCEqihNQyGAF/Qtw6I7oefx P3wAoJtMA3n2U9pYNrwIi/OD808rWapE
=tQwe
-----END PGP SIGNATURE-----