]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
sockets: Remove the limitation of --tcp-nodelay to be server-only
authorDavid Sommerseth <davids@redhat.com>
Tue, 9 Dec 2014 09:52:44 +0000 (10:52 +0100)
committerDavid Sommerseth <davids@redhat.com>
Tue, 9 Dec 2014 10:00:17 +0000 (11:00 +0100)
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
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 1418118764-17846-1-git-send-email-openvpn.list@topphemmelig.net
URL: http://article.gmane.org/gmane.network.openvpn.devel/9334
(cherry picked from commit 706283d3765d1ee62dbd913fbfc191855b92528d)

src/openvpn/helper.c
src/openvpn/options.c

index 0ed0b2ba189b3572053a89a90b60c6f8fd4662b3..339e2aea8b868a674da78a54c10830abc8df4c01 100644 (file)
@@ -534,7 +534,7 @@ helper_tcp_nodelay (struct options *o)
        }
       else
        {
-         ASSERT (0);
+         o->sockflags |= SF_TCP_NODELAY;
        }
     }
 #endif
index 5bddca4acfe07aace13ccdfd245a96e880e9e4e0..99d98b42470db85cf9d0cd40af7a7a9af2e852c2 100644 (file)
@@ -2126,7 +2126,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