summaryrefslogtreecommitdiff
path: root/src/openvpn/comp-lz4.c
diff options
context:
space:
mode:
authorBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
committerBernhard Schmidt <berni@debian.org>2020-09-01 16:52:17 +0200
commit9fc3b98112217f2d92a67977dbde0987cc7a1803 (patch)
tree29fcc8654ee65d9dd89ade797bea2f3d9dfd9cfd /src/openvpn/comp-lz4.c
parenta8758c0e03eed188dcb9da0e4fd781a67c25bf1e (diff)
parent69b02b1f7fd609d84ace13ab04697158de2418a9 (diff)
Merge branch 'debian/experimental-2.5'
Diffstat (limited to 'src/openvpn/comp-lz4.c')
-rw-r--r--src/openvpn/comp-lz4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/openvpn/comp-lz4.c b/src/openvpn/comp-lz4.c
index f2916bd..30e6da9 100644
--- a/src/openvpn/comp-lz4.c
+++ b/src/openvpn/comp-lz4.c
@@ -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);