summaryrefslogtreecommitdiff
path: root/src/openvpn/comp-lz4.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2021-11-29 20:51:58 +0100
committerJörg Frings-Fürst <debian@jff.email>2021-11-29 20:51:58 +0100
commit6e3e95a9da9458ddf0874b4bd1c8ce6b47fcef27 (patch)
tree6e3667709d99f857d90b9831426f6a32ee70d113 /src/openvpn/comp-lz4.c
parentb29f419d68b26b75a44e3ac00748875f1003b900 (diff)
parentf2b3dda12a731c2e0971cb7889728edaf23f6cb0 (diff)
Merge branch 'upstream' into develop
Diffstat (limited to 'src/openvpn/comp-lz4.c')
-rw-r--r--src/openvpn/comp-lz4.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/openvpn/comp-lz4.c b/src/openvpn/comp-lz4.c
index f2916bd..3cb427e 100644
--- a/src/openvpn/comp-lz4.c
+++ b/src/openvpn/comp-lz4.c
@@ -5,8 +5,8 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
- * Copyright (C) 2013-2018 Gert Doering <gert@greenie.muc.de>
+ * Copyright (C) 2002-2021 OpenVPN Inc <sales@openvpn.net>
+ * Copyright (C) 2013-2021 Gert Doering <gert@greenie.muc.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -35,7 +35,7 @@
#if defined(NEED_COMPAT_LZ4)
#include "compat-lz4.h"
#else
-#include "lz4.h"
+#include <lz4.h>
#endif
#include "comp.h"
@@ -70,8 +70,9 @@ do_lz4_compress(struct buffer *buf,
{
/*
* In order to attempt compression, length must be at least COMPRESS_THRESHOLD.
+ * and asymmetric compression must be disabled
*/
- if (buf->len >= COMPRESS_THRESHOLD)
+ if (buf->len >= COMPRESS_THRESHOLD && (compctx->flags & COMP_F_ALLOW_COMPRESS))
{
const size_t ps = PAYLOAD_SIZE(frame);
int zlen_max = ps + COMP_EXTRA_BUFFER(ps);