Re: [Openvpn-devel] [PATCH] Reduce default restart pause to 1 second

2022-12-19 Thread Frank Lichtenheld
On Sun, Dec 18, 2022 at 02:58:10PM -0500, selva.n...@gmail.com wrote:
> From: Selva Nair 
> 
> Current value of restart pause is 5 seconds which feels
> unduly long. Reduce it to 1 second.
> 
> User can still customize the delay using the first parameter for
> "--connect-retry".
> 
> Also improve the description of "--connect-retry" in the
> man page.

Some comments about that part:
 
> diff --git a/doc/man-sections/client-options.rst 
> b/doc/man-sections/client-options.rst
> index 07651479..37d24044 100644
> --- a/doc/man-sections/client-options.rst
> +++ b/doc/man-sections/client-options.rst
> @@ -138,7 +138,7 @@ configuration.
>Set ``--verb 6`` for debugging info showing the transformation of
>src/dest addresses in packets.
>  
> ---connect-retry n
> +--connect-retry n [max]

This breaks the formatting, because rst option lists are stupid and
only expect zero or one arguments.
Needs to use the "args" -> "valid syntaxes" pattern seen elsewhere
in the documentation.

>Wait ``n`` seconds between connection attempts (default :code:`5`).

You didn't actually adapt the default here.

>Repeated reconnection attempts are slowed down after 5 retries per
>remote by doubling the wait time after each unsuccessful attempt. An

Regards,
-- 
  Frank Lichtenheld


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


Re: [Openvpn-devel] [PATCH] Reduce default restart pause to 1 second

2022-12-19 Thread Gert Doering
Hi,

On Mon, Dec 19, 2022 at 01:12:32PM +0100, Arne Schwabe wrote:
> Am 18.12.22 um 20:58 schrieb selva.n...@gmail.com:
> > +--connect-retry n [max]
> > Wait ``n`` seconds between connection attempts (default :code:`5`).
> 
> you were close. but forgot to change the 5 in the next line to also say 1.

I can do that on the fly ("not a code change") if you agree to the
change otherwise - since Selva quoted you here... :-)

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] Reduce default restart pause to 1 second

2022-12-19 Thread Arne Schwabe

Am 18.12.22 um 20:58 schrieb selva.n...@gmail.com:

+--connect-retry n [max]
Wait ``n`` seconds between connection attempts (default :code:`5`).


you were close. but forgot to change the 5 in the next line to also say 1.

Arne


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


[Openvpn-devel] [PATCH] Reduce default restart pause to 1 second

2022-12-18 Thread selva . nair
From: Selva Nair 

Current value of restart pause is 5 seconds which feels
unduly long. Reduce it to 1 second.

User can still customize the delay using the first parameter for
"--connect-retry".

Also improve the description of "--connect-retry" in the
man page.

Signed-off-by: Selva Nair 
---
Whle reviewing commit 5d429efd9720109b9c9f1265f5d351a75a401942
Arne had suggested this, but I failed to follow up:

Quoting from Message ID 11772d2a-4877-0ed0-2484-7ef66e059...@rfc2549.org

Btw. if we introduce this backoff mechansim I think it is safe to lower
the connect-retry small time from 5 to 1 since the potential for looping
very fast through the connection entries is not there anymore.


 doc/man-sections/client-options.rst | 2 +-
 src/openvpn/options.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/man-sections/client-options.rst 
b/doc/man-sections/client-options.rst
index 07651479..37d24044 100644
--- a/doc/man-sections/client-options.rst
+++ b/doc/man-sections/client-options.rst
@@ -138,7 +138,7 @@ configuration.
   Set ``--verb 6`` for debugging info showing the transformation of
   src/dest addresses in packets.
 
---connect-retry n
+--connect-retry n [max]
   Wait ``n`` seconds between connection attempts (default :code:`5`).
   Repeated reconnection attempts are slowed down after 5 retries per
   remote by doubling the wait time after each unsuccessful attempt. An
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 4383c953..4442697f 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -815,7 +815,7 @@ init_options(struct options *o, const bool init_gc)
 o->ce.proto = PROTO_UDP;
 o->ce.af = AF_UNSPEC;
 o->ce.bind_ipv6_only = false;
-o->ce.connect_retry_seconds = 5;
+o->ce.connect_retry_seconds = 1;
 o->ce.connect_retry_seconds_max = 300;
 o->ce.connect_timeout = 120;
 o->connect_retry_max = 0;
-- 
2.34.1



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