Re: [Openvpn-devel] [PATCH 20/25] dco-win: add platform dependant check on incompatible options

2022-08-11 Thread Gert Doering
Hi,

On Fri, Jun 24, 2022 at 10:38:04AM +0200, Antonio Quartulli wrote:
> Some platforms may have different constraints in terms of incompatible
> opions, therefore we add a function that explicitly checks those.
> 
> Also, add generic option check for when ovpn-dco-win is in use.

Looking more closely at this, this patch needs a carefuly rebase :-)

> --- a/src/openvpn/dco.c
> +++ b/src/openvpn/dco.c
> @@ -190,6 +190,26 @@ dco_update_keys(dco_context_t *dco, struct tls_multi 
> *multi)
>  }
>  }
>  
> +static bool
> +dco_check_option_conflict_platform(int msglevel, const struct options *o)
> +{
> +#if defined(_WIN32)
> +if (o->mode == MODE_SERVER)
> +{

... it *introduces* dco_check_option_conflict_platform() with "only
windows" content, but in the current master tree, this function already
exists, with Linux content...

gert
-- 
"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 g...@greenie.muc.de


signature.asc
Description: PGP signature
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 20/25] dco-win: add platform dependant check on incompatible options

2022-07-19 Thread Gert Doering
Hi,

this one has an ACK, but needs a v2 still, because...

On Fri, Jun 24, 2022 at 10:38:04AM +0200, Antonio Quartulli wrote:
> Some platforms may have different constraints in terms of incompatible
> opions, therefore we add a function that explicitly checks those.
> 
> Also, add generic option check for when ovpn-dco-win is in use.
> 
> Signed-off-by: Antonio Quartulli 
> Signed-off-by: Lev Stipakov 
[..]
> --- a/src/openvpn/options.c
> +++ b/src/openvpn/options.c
> @@ -2376,6 +2376,11 @@ options_postprocess_verify_ce(const struct options 
> *options,
>  {
>  msg(M_USAGE, "--windows-driver wintun requires --dev tun");
>  }
> +
> +if (options->windows_driver == WINDOWS_DRIVER_WINDCO)
> +{
> +dco_check_option_conflict(M_USAGE, options);
> +}
>  #endif /* ifdef _WIN32 */

... the WINDOWS_DRIVER_WINDCO enum is only introduced in one of the
later hunks.

gert
-- 
"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 g...@greenie.muc.de


signature.asc
Description: PGP signature
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH 20/25] dco-win: add platform dependant check on incompatible options

2022-07-05 Thread Heiko Hund
On Freitag, 24. Juni 2022 10:38:04 CEST Antonio Quartulli wrote:
> Some platforms may have different constraints in terms of incompatible
> opions, therefore we add a function that explicitly checks those.
> 
> Also, add generic option check for when ovpn-dco-win is in use.
> 
> Signed-off-by: Antonio Quartulli 
> Signed-off-by: Lev Stipakov 

Acked-by: Heiko Hund 




___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH 20/25] dco-win: add platform dependant check on incompatible options

2022-06-24 Thread Antonio Quartulli
Some platforms may have different constraints in terms of incompatible
opions, therefore we add a function that explicitly checks those.

Also, add generic option check for when ovpn-dco-win is in use.

Signed-off-by: Antonio Quartulli 
Signed-off-by: Lev Stipakov 
---
 src/openvpn/dco.c | 25 +
 src/openvpn/options.c |  5 +
 2 files changed, 30 insertions(+)

diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c
index 1612a64e..448f29b5 100644
--- a/src/openvpn/dco.c
+++ b/src/openvpn/dco.c
@@ -190,6 +190,26 @@ dco_update_keys(dco_context_t *dco, struct tls_multi 
*multi)
 }
 }
 
+static bool
+dco_check_option_conflict_platform(int msglevel, const struct options *o)
+{
+#if defined(_WIN32)
+if (o->mode == MODE_SERVER)
+{
+msg(msglevel, "Only client and p2p data channel offload is supported "
+"with ovpn-dco-win.");
+return false;
+}
+
+if (o->persist_tun)
+{
+msg(msglevel, "--persist-tun is not supported with ovpn-dco-win.");
+return false;
+}
+#endif
+return true;
+}
+
 static bool
 dco_check_option_conflict_ce(const struct connection_entry *ce, int msglevel)
 {
@@ -228,6 +248,11 @@ dco_check_option_conflict(int msglevel, const struct 
options *o)
 return false;
 }
 
+if (!dco_check_option_conflict_platform(msglevel, o))
+{
+return false;
+}
+
 if (dev_type_enum(o->dev, o->dev_type) != DEV_TYPE_TUN)
 {
 msg(msglevel, "Note: dev-type not tun, disabling data channel 
offload.");
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 7b450296..d9da8b8b 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -2376,6 +2376,11 @@ options_postprocess_verify_ce(const struct options 
*options,
 {
 msg(M_USAGE, "--windows-driver wintun requires --dev tun");
 }
+
+if (options->windows_driver == WINDOWS_DRIVER_WINDCO)
+{
+dco_check_option_conflict(M_USAGE, options);
+}
 #endif /* ifdef _WIN32 */
 
 /*
-- 
2.35.1



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel