dco: disable DCO if --allow-compress yes/asym was specified
PATCH 1/1 dco: disable DCO if --allow-compress yes/asym was specified
Allowing compression means that we may accept a pushable compress setting.
This scenario can't work with DCO therefore disable it when compression is allowed.
--- src/openvpn/dco.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
src/openvpn/dco.c +4 -2
@@ -352,9 +352,11 @@ dco_check_option_conflict(int msglevel, const struct options *o) }#if defined(USE_COMP ) -if (o->comp.alg !=COMP_ALG_UNDEF ) +if (o->comp.alg !=COMP_ALG_UNDEF + || o->comp.flags &COMP_F_ALLOW_ASYM + || o->comp.flags &COMP_F_ALLOW_COMPRESS ) { -msg (msglevel,"Note: Using compression disables data channel offload." ); +msg (msglevel,"Note: Allowing or using compression disables data channel offload." );if (o->mode ==MODE_SERVER && !(o->comp.flags &COMP_F_MIGRATE )) {
Signature · 1 line
2.35.1
Am 05.08.22 um 17:13 schrieb Antonio Quartulli:
Quoted 5 lines
Allowing compression means that we may accept a pushable compress setting.
This scenario can't work with DCO therefore disable it when compression is allowed.
Hi,
src/openvpn/dco.c dco_check_option_conflict(int msglevel, const struct options *o) · line 359
Quoted 8 lines · Antonio Quartulli
#if
defined(USE_COMP)src/openvpn/dco.c +4
-2-if (o->comp.alg !=COMP_ALG_UNDEF ) +if (o->comp.alg !=COMP_ALG_UNDEF + || o->comp.flags &COMP_F_ALLOW_ASYM + || o->comp.flags &COMP_F_ALLOW_COMPRESS ) { -msg (msglevel,"Note: Using compression disables data channel offload." ); +msg (msglevel,"Note: Allowing or using compression disables data channel offload." );
It does have an ACK, and it does what it promises to, but I do not like the message - as in, it's technically correct, but it could be a bit more helpful in regards to "what does the user need to do now?"
What about
Quoted 1 line
+ msg(msglevel, "Note: '--allow-compression' is not set to 'no'. Disabling data channel offload.");
so they know "ah, need to look for that option" (and either set it to "no" or remove it from the config).
Yes, this is not mentioning "using compression" at all anymore, but this is indirectly handled - if you have "--allow-compression no", it will disallow use of "--compress <whatever>" on its own, so we do not need to mention it in the DCO specific part.
gert
Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]...PATCH v2 1/1 dco: disable DCO if --allow-compress yes/asym was specified
In reply to Antonio QuartulliAllowing compression means that we may accept a pushable compress setting.
This scenario can't work with DCO therefore disable it when compression is allowed.
---
Changes from v1:
* improve wording for message
--- src/openvpn/dco.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
src/openvpn/dco.c +4 -2
@@ -352,9 +352,11 @@ dco_check_option_conflict(int msglevel, const struct options *o) }#if defined(USE_COMP ) -if (o->comp.alg !=COMP_ALG_UNDEF ) +if (o->comp.alg !=COMP_ALG_UNDEF + || o->comp.flags &COMP_F_ALLOW_ASYM + || o->comp.flags &COMP_F_ALLOW_COMPRESS ) { -msg (msglevel,"Note: Using compression disables data channel offload." ); +msg (msglevel,"Note: '--allow-compression' is not set to 'no', disabling data channel offload." );if (o->mode ==MODE_SERVER && !(o->comp.flags &COMP_F_MIGRATE )) {
Signature · 1 line
2.35.1
Same functionality as v1, wording as suggested. Tested, does the job :-)
Client with "--allow-compression yes --comp-lzo" ->
2022-08-07 12:20:16 Note: '--allow-compression' is not set to 'no', disabling data channel offload.
Client with "--allow-compression no --comp-lzo" ->
Options error: Cannot set comp-lzo to '(null)', allow-compression is set to 'no'
(this error message could use a bit of improvement, though)
Client with "--allow-compression no #--comp-lzo" ->
2022-08-07 12:22:15 DCO device tun7 opened
We might find ourselves returning here, and the release notes for 2.6 need careful tending to ensure the interaction of DCO with "all these options" is communicated really well.
Your patch has been applied to the master branch.
commit c984d0b17056f87cd580260edd2e89874c601566
Author: Antonio Quartulli Date: Sun Aug 7 11:53:29 2022 +0200
dco: disable DCO if --allow-compress yes/asym was specified
Signed-off-by: Antonio Quartulli <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg24834.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering