[Openvpn-devel] [PATCH applied] Re: Preparing for better signal handling: some code refactoring

2023-01-05 Thread Gert Doering
Acked-by: Gert Doering (Lightly) tested on Linux, FreeBSD - namely, does it compile, pass t_client tests (which send SIGTERM), pass t_server tests (which uses per-instance SIGUSR1/SIGTERM). Plus "push to github, does it break windows?". Stared at the code for a long time - most of it is really

[Openvpn-devel] [PATCH applied] Re: Refactor signal handling in openvpn_getaddrinfo

2023-01-05 Thread Gert Doering
Acked-by: Gert Doering This is basically the same thing as 1/5, just for the getaddrinfo() related functions. And no, I have no idea why they are treated "special", and getaddrinfo() is not a syscall. OTOH, getaddrinfo() spends most of its time in "waiting for DNS packets", which might result i

Re: [Openvpn-devel] [PATCH v2 4/5] Fix signal handling on Windows

2023-01-05 Thread Lev Stipakov
Hi, > -else if (n > 0) > +else > { > -sleep(n); > +#ifdef _WIN32 > +win32_sleep(n); > +#else > +if (n > 0) > +{ > +sleep(n); My understanding is that we want to have interruptible sleep. In this case, what is the point of calling win32_sle

Re: [Openvpn-devel] [PATCH v2 4/5] Fix signal handling on Windows

2023-01-05 Thread Selva Nair
Hi, Thanks for the careful review On Thu, Jan 5, 2023 at 11:20 AM Lev Stipakov wrote: > Hi, > > > -else if (n > 0) > > +else > > { > > -sleep(n); > > +#ifdef _WIN32 > > +win32_sleep(n); > > +#else > > +if (n > 0) > > +{ > > +sleep(n); > >

[Openvpn-devel] [PATCH] Add connect-freq-initial option to limit initial connection responses

2023-01-05 Thread Arne Schwabe
This limits the nubmer of packets OpenVPN will respond to. This avoid OpenVPN server being abused for refelection attacks in a large scale as we gotten a lot more efficient with the cookie approach in our initial connection approach. The defaults of 100 attempts per 10s should work for most people

Re: [Openvpn-devel] [PATCH v2 4/5] Fix signal handling on Windows

2023-01-05 Thread Selva Nair
Hi > >> >> Under what circumstances are we supposed to do the waiting again? If >> we get a signal, we bail out. >> If the wait times out, we bail out. If wait fails, we do Sleep >> (although at this point we probably have a bigger issue). >> > > Probably never -- there is a WAIT_ABANDONED which

Re: [Openvpn-devel] [PATCH] Add connect-freq-initial option to limit initial connection responses

2023-01-05 Thread Gert Doering
Hi, first of all, feature-ACK, and "structure-ACK" - this is a lightweight implementation that can go into 2.6 with not much testing, which should "get the thing done" for most cases. A more sophisticated implementation with per-IP hashing (to avoid (ab-)using the rate-limiter to drown-out legiti

[Openvpn-devel] [PATCH v3 4/5] Fix signal handling on Windows

2023-01-05 Thread selva . nair
From: Selva Nair - In win32_signal_get() re-order the check so that Windows signals are picked up even if signal_received is non-zero - When management is not active, management_sleep() becomes sleep() but it is not interruptible by signals on Windows. Fix this by periodically checking for

[Openvpn-devel] [PATCH v4 4/5] Fix signal handling on Windows

2023-01-05 Thread selva . nair
From: Selva Nair - In win32_signal_get() re-order the check so that Windows signals are picked up even if signal_received is non-zero - When management is not active, management_sleep() becomes sleep() but it is not interruptible by signals on Windows. Fix this by periodically checking for