[Openvpn-devel] [PATCH v2] doc: add "ovpn-dco" to usage and man page

2022-09-17 Thread Lev Stipakov
From: Lev Stipakov While on it, remove redundant sentence and quotation mark from --windows-driver man description. Signed-off-by: Lev Stipakov --- v2: - mark ovpn-dco adapter as default, instead of tap-windows6 - mention that ovpn-dco requires --dev tun doc/man-sections/windows

[Openvpn-devel] [PATCH] doc: add "ovpn-dco" to usage and man page

2022-09-15 Thread Lev Stipakov
From: Lev Stipakov While on it, remove redundant sentence and quotation from --windows-driver man description. Signed-off-by: Lev Stipakov --- doc/man-sections/windows-options.rst | 8 src/openvpn/options.c| 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff

[Openvpn-devel] [PATCH v4] Use DCO on Windows by default

2022-09-15 Thread Lev Stipakov
From: Lev Stipakov On startup, check following conditions: - ovpn-dco-win driver is installed. Perform this check by trying to open adapter by symbolic name. - options are compatible with dco. Same checks as on Linux and FreeBSD. In addition, check that --mode server is not used

[Openvpn-devel] [PATCH] msvc: add branch name and commit hash to version output

2022-09-22 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- build/msvc/msvc-generate/Makefile.mak

[Openvpn-devel] [PATCH release/2.5] msvc: add branch name and commit hash to version output

2022-09-22 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- build/msvc/msvc-generate/Makefile.mak

[Openvpn-devel] [PATCH v2 release/2.5] msvc: add branch name and commit hash to version output

2022-09-22 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v2: - fix copyright year 2002 -> 2

[Openvpn-devel] [PATCH] msvc: add branch name and commit hash to version output

2022-09-22 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v2: - fix copyright year 2002 -> 2

Re: [Openvpn-devel] [PATCH release/2.5] msvc: add branch name and commit hash to version output

2022-09-22 Thread Lev Stipakov
Hi, I've sent v2 with copyright year and "not-a-git" -> "unknown" fix. (I forgot to name master patch to PATCH v2) Yes, when doing releases we do git checkout. I have tested MSI installers produced by openvpn-build GitHub automation, which uses the same script (build-and-package.ps1) which

[Openvpn-devel] [PATCH v5 release/2.5] msvc: add branch name and commit hash to version output

2022-09-26 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v5: - replace "detached" with &qu

[Openvpn-devel] [PATCH v5] msvc: add branch name and commit hash to version output

2022-09-26 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v5: - replace "detached" with &qu

[Openvpn-devel] [PATCH v3] Use DCO on Windows by default

2022-09-14 Thread Lev Stipakov
From: Lev Stipakov On startup, check following conditions: - ovpn-dco-win driver is installed. Perform this check by trying to open adapter by symbolic name. - options are compatible with dco. Same checks as on Linux and FreeBSD. In addition, check that --mode server is not used

[Openvpn-devel] [PATCH] dco.c: check certain options only on startup

2022-09-09 Thread Lev Stipakov
From: Lev Stipakov Following options are set on startup and cannot be changed later: - dev - dev-type - connections list - mode - topology Same for system-wide availability of dco. dco_check_option_conflict(), where those options were checked, is also called in server mode when client

[Openvpn-devel] [PATCH v2] dco.c: check certain options only on startup

2022-09-09 Thread Lev Stipakov
From: Lev Stipakov Following options are set on startup and cannot be changed later: - dev - dev-type - connections list - mode - topology Same for system-wide availability of dco. dco_check_option_conflict(), where those options were checked, is also called in server mode when client

[Openvpn-devel] [PATCH] Use DCO on Windows by default

2022-09-09 Thread Lev Stipakov
From: Lev Stipakov On startup, check following conditions: - ovpn-dco-win driver is installed. Perform this check by trying to open adapter by symbolic name. - options are compatible with dco. Same checks as on Linux and FreeBSD. In addition, check that --mode server is not used

[Openvpn-devel] [PATCH v4] msvc: add branch name and commit hash to version output

2022-09-23 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v4: - replace backslash with slash - instead

[Openvpn-devel] [PATCH v4 release/2.5] msvc: add branch name and commit hash to version output

2022-09-23 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v4: - replace backslash with slash - instead

[Openvpn-devel] [PATCH v3] msvc: add branch name and commit hash to version output

2022-09-23 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v3: - properly handle branchnames like release

[Openvpn-devel] [PATCH v3 release/2.5] msvc: add branch name and commit hash to version output

2022-09-23 Thread Lev Stipakov
From: Lev Stipakov Add a simple python script which generates header with branch name and commit hash #defines. While on it, fix filename in msvc-generate.vcxproj and add proper copyright header to Makefile.mak. Signed-off-by: Lev Stipakov --- v3: - properly handle branchnames like

[Openvpn-devel] [PATCH v2] msvc: remove .filters files

2022-09-05 Thread Lev Stipakov
From: Lev Stipakov Filters file defines custom logical folders in Solution Explorer. We don't use this functionality and it requires maintenance, so let's remove those. While on it, remove dco linux files from VS project. Signed-off-by: Lev Stipakov --- v2: remove .filters files from other

[Openvpn-devel] [PATCH] msvc: remove .filters file

2022-09-05 Thread Lev Stipakov
From: Lev Stipakov Filters file defines custom logical folders in Solution Explorer. We don't use this functionality and it requires maintenance, so let's remove it. While on it, remove dco linux files from VS project. Signed-off-by: Lev Stipakov --- src/openvpn/openvpn.vcxproj | 5

[Openvpn-devel] [PATCH v2] tun: properly handle device interface list

2022-08-11 Thread Lev Stipakov
From: Lev Stipakov Some adapters create multiple device interfaces and we need to enumerate all of them. Signed-off-by: Lev Stipakov --- v2: uncrustify src/openvpn/tun.c | 35 --- src/openvpn/tun.h | 2 +- 2 files changed, 21 insertions(+), 16 deletions

[Openvpn-devel] [PATCH] tun: properly handle device interface list

2022-08-11 Thread Lev Stipakov
From: Lev Stipakov Some adapters create multiple device interfaces and we need to enumerate all of them. Signed-off-by: Lev Stipakov --- src/openvpn/tun.c | 37 + src/openvpn/tun.h | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git

Re: [Openvpn-devel] [PATCH] Allow querying DCO status via management status

2022-08-14 Thread Lev Stipakov
interface, just by sending SIGUSR2, maybe "multi.c: include DCO status in status version 2" would be better? Acked-by: Lev Stipakov ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Re: [Openvpn-devel] [PATCH v102 6/7] dco-win: ensure the DCO API is not used when running on Windows

2022-08-14 Thread Lev Stipakov
ugh the OpenVPN function we use is called "link_socket_write_win32()". I would change the above mentioned comment to "normal Overlapped I/O". Maybe this could be done at commit. Also, as mentioned in chat, this should be merged before 3/7 ("dco-win: implement ovpn-dco

[Openvpn-devel] [PATCH] tun: properly handle device interface list

2022-08-15 Thread Lev Stipakov
From: Lev Stipakov Device interface is a path which is used by userspace to access device. A driver can create one or more device interfaces and specify "reference string", so that userspace could enumerate all device interfaces in the list and pick the corrct one which ends with

Re: [Openvpn-devel] [PATCH v100 05/10] dco-win: add documentation to README.dco.md

2022-08-12 Thread Lev Stipakov
Hi, +Getting started (Windows) > +- > +Getting started under windows is currently for brave people having > experience > +with windows development. You need to compile openvpn yourself and also > need > +to get the test driver installed on your system. > While I consider

Re: [Openvpn-devel] [PATCH v100 01/10] do_open_tun: restyle "can preserve TUN" check

2022-08-12 Thread Lev Stipakov
Stared at the code and slightly tested on Windows. Functionality hasn't changed and code is now easier to read. Acked-by: Lev Stipakov pe 12. elok. 2022 klo 16.08 Antonio Quartulli (a...@unstable.cc) kirjoitti: > The current condition checking if the TUN interface was preserved is > dep

Re: [Openvpn-devel] [PATCH v100 02/10] dco-win: introduce low-level code for handling ovpn-dco-win in Windows

2022-08-12 Thread Lev Stipakov
Hi, General note - this commit has no commit message and introduces a set of functions which are not yet called. Does it really make sense to split dco-win support into two commits? src/openvpn/ovpn-dco-win.h | 108 > We have ovpn_dco_linux.h and ovpn-dco-win.h. Should we

Re: [Openvpn-devel] [PATCH v100 02/10] dco-win: introduce low-level code for handling ovpn-dco-win in Windows

2022-08-12 Thread Lev Stipakov
Oh and also: 6>C:\Users\lev\Projects\openvpn\src\openvpn\dco.c(280,27): error C2039: 'disable_dco': is not a member of 'tuntap_options' 6>C:\Users\lev\Projects\openvpn\src\openvpn\tun.h(64): message : see declaration of 'tuntap_options' -Lev ___

Re: [Openvpn-devel] [PATCH v100 03/10] dco-win: add platform dependant check on incompatible options

2022-08-12 Thread Lev Stipakov
s in use. > > Signed-off-by: Antonio Quartulli > Signed-off-by: Lev Stipakov > --- > src/openvpn/dco.c | 17 +++-- > src/openvpn/options.c | 5 + > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/src/openvpn/dco.c b/src/openvpn/

Re: [Openvpn-devel] [PATCH v101 1/7] dco-win: introduce low-level code for handling ovpn-dco-win in Windows

2022-08-13 Thread Lev Stipakov
are not called yet - I am OK with that if it makes code easier to review. Disclaimer: I contributed some code to this commit, so I might be slightly biased. Acked-by: Lev Stipakov la 13. elok. 2022 klo 23.43 Antonio Quartulli (a...@unstable.cc) kirjoitti: > Signed-off-by: Arne Schwabe > Sign

[Openvpn-devel] [PATCH] error.c: remove unused crash() function

2022-08-13 Thread Lev Stipakov
From: Lev Stipakov This has been added in 2006 and as of now not used. Signed-off-by: Lev Stipakov --- src/openvpn/error.c | 9 - src/openvpn/error.h | 5 - 2 files changed, 14 deletions(-) diff --git a/src/openvpn/error.c b/src/openvpn/error.c index 7cd35b17..c8c77358 100644

Re: [Openvpn-devel] [PATCH v101 2/7] dco-win: check for incompatible options

2022-08-13 Thread Lev Stipakov
Again, this cannot be tested yet. Stared at the code and tested with follow-up commits, looks good and works as expected. Acked-by: Lev Stipakov la 13. elok. 2022 klo 23.43 Antonio Quartulli (a...@unstable.cc) kirjoitti: > At the moment dco-win doesn't support --persist-tun and --ser

Re: [Openvpn-devel] [PATCH 21/25] do_open_tun: restyle "can preserve TUN" check

2022-08-04 Thread Lev Stipakov
Hi, > +static bool > +can_preserve_tun(struct tuntap *tt) > +{ > +#ifdef TARGET_ANDROID > +return false; > +#elif _WIN32 > +return tt && tt->dco.real_tun_init; Looks like dco.real_tun_init has been added in the very next patch, 22/25. ___

[Openvpn-devel] [PATCH] dco.h: fix return type when DCO is not enabled

2022-08-17 Thread Lev Stipakov
From: Lev Stipakov The correct return type for those functions is int, so adjust return type accordingly for the cases when DCO is not defined. Signed-off-by: Lev Stipakov --- src/openvpn/dco.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openvpn/dco.h b/src

[Openvpn-devel] [PATCH v2] dco.h: fix return type when DCO is not enabled

2022-08-17 Thread Lev Stipakov
From: Lev Stipakov The correct return type for those functions is int, so adjust return type accordingly for the cases when DCO is not defined. Signed-off-by: Lev Stipakov --- v2: also do "return 0" in dco_p2p_add_new_peer() src/openvpn/dco.h | 8 1 file changed, 4 insert

[Openvpn-devel] [PATCH] tun.c: remove unused gc_arena from init_tun()

2022-08-09 Thread Lev Stipakov
From: Lev Stipakov Signed-off-by: Lev Stipakov --- src/openvpn/tun.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 54f7d72c..f3152a52 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -745,7 +745,6 @@ init_tun(const char *dev

Re: [Openvpn-devel] [PATCH 1/2] Use undo_lists for saving ring-buffer handles in interactive service

2022-12-30 Thread Lev Stipakov
the list */ > static BOOL > -CmpEngine(LPVOID item, LPVOID any) > +CmpAny(LPVOID item, LPVOID any) I wonder why it was called CmpEngine in the first place? Code looks good, tested with wintun and dco driver (latter is not affected by the change, but just to make sure). Acke

Re: [Openvpn-devel] [PATCH 2/2] Cleanup: Close duplicated handles in interactive service

2022-12-30 Thread Lev Stipakov
Hi, Indeed, no need to keep those handles for the duration of openvpn process lifetime, they're needed only for registration. Compiled and tested. Acked-by: Lev Stipakov ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https

Re: [Openvpn-devel] [PATCH] Properly unmap ring buffer file-map in interactive service

2022-12-29 Thread Lev Stipakov
Hi, > The return value of MapViewOfFile must be passed to UnmapViewofFile, > instead of the file handle. Good catch! > Fixes #206 Strangely enough, I am not able to reproduce this bug - I posted logs to the GitHub issue. Fix indeed makes sense. Indeed, according to docs, UnmapViewOfFile()

Re: [Openvpn-devel] [PATCH v2] Properly unmap ring buffer file-map in interactive service

2022-12-29 Thread Lev Stipakov
Acked-by: Lev Stipakov to 29. jouluk. 2022 klo 15.48 selva.n...@gmail.com kirjoitti: > > From: Selva Nair > > The return value of MapViewOfFile must be passed to UnmapViewofFile, > instead of the file handle. > > Fixes #206 > > v2: move *ring = NULL inside if {} &g

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

Re: [Openvpn-devel] [PATCH 1/3] Use IPAPI for setting ipv6 routes when iservice not available

2023-01-06 Thread Lev Stipakov
Hi, Compiled and slightly tested - pinged server's tunnel IPv6 address. Acked-by: Lev Stipakov ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Re: [Openvpn-devel] [PATCH 2/3] Distinguish route addition errors from route already exists

2023-01-06 Thread Lev Stipakov
Hi, > else if ((flags & ROUTE_METHOD_MASK) == ROUTE_METHOD_IPAPI) > { > status = add_route_ipapi(r, tt, ai); > -msg(D_ROUTE, "Route addition via IPAPI %s", status ? "succeeded" > : "failed"); > +msg(D_ROUTE, "Route addition via IPAPI %s",

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

2023-01-06 Thread Lev Stipakov
\Projects\openvpn-build\src\openvpn\ARM64-Output\Debug\openvpn.exe (process 11476) exited with code 0. Acked-by: Lev Stipakov ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel

[Openvpn-devel] [PATCH] tun: move print_windows_driver() out of tun.h

2023-01-09 Thread Lev Stipakov
From: Lev Stipakov We got warnings from MinGW about function being defined but not used when compiling modules which include tun.h. This function is not defined as inline, so its definition should not be in header. Since this is not a performance critical, no need to make it inline. Leave

Re: [Openvpn-devel] [PATCH v2 2/3] Distinguish route addition errors from route already exists

2023-01-08 Thread Lev Stipakov
I reviewed v1, checked that true/false has been replaced with 0/1/2. Checked that the only change in v2 is that "succeeded/skipped" is replaced with "succeeded". Compiled and tested, looks good. Acked-by: Lev Stipakov ___ Openvp

Re: [Openvpn-devel] [PATCH] dco: print proper message in case of transport disconnection

2023-01-12 Thread Lev Stipakov
TERM[soft,ovpn-dco: transport disconnected] received, client-instance > exiting Without this patch, the error message was > SIGTERM[soft,ovpn-dco: unknown reason] received, client-instance exiting Acked-by: Lev Stipakov -- -Lev ___ Openvpn-dev

[Openvpn-devel] [PATCH 1/2] management: refactor bytecount routines

2022-12-12 Thread Lev Stipakov
From: Lev Stipakov In preparation of DCO stats support, simplify call chains of bytecount routines. No functional changes. Signed-off-by: Lev Stipakov --- src/openvpn/forward.c | 4 +-- src/openvpn/manage.c | 64 - src/openvpn/manage.h | 66

[Openvpn-devel] [PATCH 2/2] management: add timer to push BYTECOUNT

2022-12-12 Thread Lev Stipakov
From: Lev Stipakov At the moment BYTECOUNT in,out is pushed if there is traffic. With DCO, userspace process doesn't see the traffic, so we need to add a timer which periodically fetches stats from DCO and pushes to management client. The timer interval is set by existing "byteco

Re: [Openvpn-devel] [PATCH 1/4] Read DCO traffic stats from the kernel

2022-12-12 Thread Lev Stipakov
Hi, This is good - I need an API to get stats to make openvpn-gui show those (via the management interface). I am not too much into FreeBSD parts, but > +hash_iterator_init(m->hash, ); > + > +while ((he = hash_iterator_next())) > +{ > +struct multi_instance *mi = (struct

[Openvpn-devel] [PATCH] msvc: upgrade to Visual Studio 2022

2022-12-14 Thread Lev Stipakov
From: Lev Stipakov Signed-off-by: Lev Stipakov --- build/msvc/msvc-generate/msvc-generate.vcxproj | 12 ++-- src/compat/compat.vcxproj | 12 ++-- src/openvpn/openvpn.vcxproj| 12 ++-- src/openvpnmsica/openvpnmsica.vcxproj

[Openvpn-devel] [PATCH] Introduce dco_get_peer_stats API and Windows implementation

2022-12-14 Thread Lev Stipakov
From: Lev Stipakov dco_get_peer_stats fetches stats for a single peer. This is mostly useful in client mode. So far only Windows implements that. Signed-off-by: Lev Stipakov --- src/openvpn/dco.h | 13 + src/openvpn/dco_freebsd.c | 7 +++ src/openvpn/dco_linux.c

[Openvpn-devel] [PATCH] Rename dco_get_peer_stats to dco_get_peer_stats_multi

2022-12-14 Thread Lev Stipakov
From: Lev Stipakov Existing API and implementation (FreeBSD only) are designed for server usage. Rename it to *_multi to indicate that and not to mix with upcoming client API/implementation. Signed-off-by: Lev Stipakov --- src/openvpn/dco.h | 4 ++-- src/openvpn/dco_freebsd.c | 2

Re: [Openvpn-devel] [PATCH] Introduce dco_get_peer_stats API and Windows implementation

2022-12-14 Thread Lev Stipakov
Hi, > Good to see this happening.. Turns out there is a bug in the driver at the moment - it doesn't update OUT bytes. This particular API hasn't been used in a while. > Does this data from the driver include both control and data channel bytes? Yes, at the moment those are "link" bytes and

Re: [Openvpn-devel] [PATCH] Persist DCO client data channel traffic stats on restart

2022-12-16 Thread Lev Stipakov
ve DCO stats before tearing the tunnel down. But anyway, Code looks good, compiled and tested - stats are indeed preserved across reconnect. Acked-by: Lev Stipakov ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourcefor

[Openvpn-devel] [PATCH] git-version.py: use tag as branch name

2022-12-16 Thread Lev Stipakov
From: Lev Stipakov Git magic to get branch name git rev-parse --symbolic-full-name HEAD doesn't work when we're on tag, which is the case when we build releases. In this case, use tag name as branch name with another git magic: git describe --tags This fixes https://github.com/OpenVPN

[Openvpn-devel] [PATCH v2] git-version.py: proper support for tags

2022-12-19 Thread Lev Stipakov
From: Lev Stipakov Git magic to get branch name git rev-parse --symbolic-full-name HEAD doesn't work when we're on tag, which is the case when we build releases. First, try to get tag name with git describe --exact-match and if this fails, get branch name as before. Use

[Openvpn-devel] [PATCH v3] git-version.py: proper support for tags

2022-12-19 Thread Lev Stipakov
From: Lev Stipakov Git magic to get branch name git rev-parse --symbolic-full-name HEAD doesn't work when we're on tag, which is the case when we build releases. First, try to get tag name with git describe --exact-match and if this fails, get branch name as before. Use

[Openvpn-devel] [PATCH] management: add timer to output BYTECOUNT

2022-12-13 Thread Lev Stipakov
From: Lev Stipakov BYTECOUNT on management interface is used to display client stats, for example by openvpn-gui. At the moment BYTECOUNT is sent if there is a traffic. With DCO, userspace process doesn't see data channel traffic, BYTECOUNT is not sent and therefore stats are not updated. Fix

[Openvpn-devel] [PATCH v2] Introduce dco_get_peer_stats API and Windows implementation

2022-12-14 Thread Lev Stipakov
From: Lev Stipakov dco_get_peer_stats fetches stats for a single peer. This is mostly useful in client mode. So far only Windows implements that. Signed-off-by: Lev Stipakov --- v2: fix error message text src/openvpn/dco.h | 13 + src/openvpn/dco_freebsd.c | 7

Re: [Openvpn-devel] [PATCH] Introduce dco_get_peer_stats API and Windows implementation

2022-12-14 Thread Lev Stipakov
Hi, Selva has asked about a build which includes this patch. Here is MSI installer which incorporates required client patches - management: add timer to output BYTECOUNT - Introduce dco_get_peer_stats API and Windows implementation and a new driver version (0.8.3) with stats fixes.

Re: [Openvpn-devel] [PATCH] Introduce dco_get_peer_stats API and Windows implementation

2022-12-14 Thread Lev Stipakov
> This data will also show up as stats on the adapter (device node) and should > include all traffic that passes through it, no? System adapter stats show only tun traffic - the one driver indicates to NetAdapter. For BYTECOUNT we (userspace client) currently show link traffic - encapsulated

[Openvpn-devel] [PATCH v2] management: add timer to output BYTECOUNT

2022-12-14 Thread Lev Stipakov
From: Lev Stipakov BYTECOUNT on management interface is used to display client stats, for example by openvpn-gui. At the moment BYTECOUNT is sent if there is a traffic. With DCO, userspace process doesn't see data channel traffic, BYTECOUNT is not sent and therefore stats are not updated. Fix

Re: [Openvpn-devel] [PATCH] Introduce dco_get_peer_stats API and Windows implementation

2022-12-15 Thread Lev Stipakov
Hi, > In non-dco use, the stats as persisted by the management interface are not > reset throughout the lifetime of the process. With dco, what the driver > provides is "Peer Stats" which is reset in OvpnPeerNew() (linux appears to > do the same). A quick option > would be to move the

Re: [Openvpn-devel] [PATCH] vcpkg-ports/pkcs11-helper: support loader flags

2022-12-14 Thread Lev Stipakov
code of openvpn in this patch. I haven't tested actual pkcs11 functionality. Note that while applying "outside" patch "git am" complains about whitespace errors, but "this is fine" - those are from the "inside" patch. Acked-by: Lev Stipakov ___

Re: [Openvpn-devel] [PATCH applied] Re: management: add timer to output BYTECOUNT

2022-12-15 Thread Lev Stipakov
Hi, > So it seems as the timer activation got delayed somehow > -> this is something we need to come back to, when Linux/FreeBSD DCO > stats get implemented. Starting with "management-hold", then "bytecount", > then "hold release" gave me counters right away. Mysteries... This is because we do

[Openvpn-devel] [PATCH] INSTALL: update Windows notes

2022-11-29 Thread Lev Stipakov
From: Lev Stipakov Also slightly fix indent. Signed-off-by: Lev Stipakov --- INSTALL | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/INSTALL b/INSTALL index da9b88e7..db24e98c 100644 --- a/INSTALL +++ b/INSTALL @@ -24,9 +24,9 @@ OpenVPN releases

[Openvpn-devel] [PATCH] dco: disable dco on Windows if --remote is not defined

2022-12-01 Thread Lev Stipakov
From: Lev Stipakov At the moment Windows driver requires remote to work. Signed-off-by: Lev Stipakov --- src/openvpn/dco.c | 8 1 file changed, 8 insertions(+) diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 47fb0003..19a449ba 100644 --- a/src/openvpn/dco.c +++ b/src

[Openvpn-devel] [PATCH] openvpnmsica: remove dco installer custom actions

2023-01-19 Thread Lev Stipakov
From: Lev Stipakov Those have been moved into MSM to be reused by openvpn-gui and Connect. Signed-off-by: Lev Stipakov --- src/openvpnmsica/openvpnmsica.c | 283 1 file changed, 283 deletions(-) diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica

Re: [Openvpn-devel] [PATCH v2 2/2] Cleanup route error and debug logging on Windows

2023-01-20 Thread Lev Stipakov
same refactoring as add_route. Anyway, this is not really about this patch. Acked-by: Lev Stipakov ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel

[Openvpn-devel] [PATCH] openvpnmsica: remove unused declarations

2023-01-24 Thread Lev Stipakov
From: Lev Stipakov That code has been moved to MSM by commit 640c4d82 ("openvpnmsica: remove dco installer custom actions") Signed-off-by: Lev Stipakov --- src/openvpnmsica/openvpnmsica.h | 26 -- 1 file changed, 26 deletions(-) diff --git a/src/op

[Openvpn-devel] [PATCH] openvpnmsica: fix adapters discovery logic for DCO

2023-01-24 Thread Lev Stipakov
From: Lev Stipakov Custom action "FindSystemInfo" finds adapters with certain hwid and assigns found adapters' guids to a certain property. Later another custom action "EvaluateTUNTAPAdapters" schedules adapter creation if the abovementioned property is not set - which mea

Re: [Openvpn-devel] [PATCH] openvpnmsica: fix adapters discovery logic for DCO

2023-01-24 Thread Lev Stipakov
Hi, >> I think this logic is needed to prevent duplicate adapter creation >> if adapter was renamed and then new version is installed. > > Is the driver still always updated (i.e., when update required) even if the > adapter is not created because of existing ones found? At the moment yes.

Re: [Openvpn-devel] [PATCH] win32: detect arm64 architecture and emulations

2022-11-05 Thread Lev Stipakov
at 11:02:47AM +0200, Lev Stipakov wrote:From: Lev Stipakov Properly detect process architecture andmachine architecture, including arm64.Print process architecture and, if machinearchitecture is different (we are running inemulation), print that too.This looks generally good, so definitely a "fe

[Openvpn-devel] [PATCH] vcpkg: use the latest versions of dependency ports

2022-11-02 Thread Lev Stipakov
From: Lev Stipakov By removing builin-baseline constraint, we force vcpkg to use latest versions of ports. As a side effect, this bumps OpenSSL to 3.0.7. While on it, update vcpkg commit in GHA. We also have to apply a workaround for GHA to make it use our vcpkg checkout instead of c:\vcpkg

Re: [Openvpn-devel] [PATCH v2 1/3] Move dco_installed from sock->info to sock->info.lsa.actual

2022-11-01 Thread Lev Stipakov
Hi, > @@ -1190,7 +1190,7 @@ link_socket_write(struct link_socket *sock, >struct buffer *buf, >struct link_socket_actual *to) > { > -if (proto_is_udp(sock->info.proto) || sock->info.dco_installed) > +if (proto_is_udp(sock->info.proto) ||

[Openvpn-devel] [PATCH] win32: detect arm64 architecture and emulations

2022-11-04 Thread Lev Stipakov
From: Lev Stipakov Properly detect process architecture and machine architecture, including arm64. Print process architecture and, if machine architecture is different (we are running in emulation), print that too. Signed-off-by: Lev Stipakov --- src/openvpn/win32.c | 123

Re: [Openvpn-devel] [PATCH v2] msvc: always call git-version.py

2022-11-11 Thread Lev Stipakov
Don't know if I can ack the patch to which I've contributed - but anyway, the makefile change looks good and the python script doesn't regenerate version header (which would trigger recompilation of some files). Tested locally and GHA is happy. Acked-by: Lev Stipakov

[Openvpn-devel] [PATCH] dco-win: use proper calling convention on x86

2023-01-31 Thread Lev Stipakov
From: Lev Stipakov WinAPI uses __stdcall calling convention on x86. Wrong calling convention causes UB, which in this case breaks dco-win functionality. Signed-off-by: Lev Stipakov --- src/openvpn/dco_win.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn

[Openvpn-devel] [PATCH v2] dco-win: use proper calling convention on x86

2023-01-31 Thread Lev Stipakov
From: Lev Stipakov WinAPI uses __stdcall calling convention on x86. Wrong calling convention causes UB, which in this case breaks dco-win functionality. Signed-off-by: Lev Stipakov --- v2: - use WINAPI instead of __stdcall - replace another existing occurence of __stdcall with WINAPI

Re: [Openvpn-devel] [PATCH v2] block-dns using iservice: fix a potential double free

2023-02-01 Thread Lev Stipakov
Hi, Stared at the code and tested with/without Citrix DME (which caused crash) - code is now cleaner (add/delete separation) and no crash anymore. Next we will fix the driver :) Acked-by: Lev Stipakov ___ Openvpn-devel mailing list Openvpn-devel

[Openvpn-devel] Fwd: [PATCH] Print DCO client stats on SIGUSR2

2023-03-23 Thread Lev Stipakov
For reference, my comments. -- Forwarded message - From: Lev Stipakov Date: Thu, Mar 23, 2023 at 9:39 AM Subject: Re: [Openvpn-devel] [PATCH] Print DCO client stats on SIGUSR2 To: Selva Nair I see the point - we now have driver-specific code in functions {multi}_print_status

[Openvpn-devel] [PATCH] Don't overwrite socket flags when using DCO on Windows

2023-03-24 Thread Lev Stipakov
From: Lev Stipakov Socket flags can be pushed, in which case they overwrite existing value. We use socket flags to distingust between DCO handle and socket on Windows. If server pushes --socket-flags, we treat DCO handle as socket and everything explodes. Fix by making link_socket_update_flags

Re: [Openvpn-devel] [PATCH] Support --inactive option for DCO

2023-03-13 Thread Lev Stipakov
Review happens at https://gerrit.openvpn.net/c/openvpn/+/143 ma 13. maalisk. 2023 klo 12.06 Lev Stipakov (lstipa...@gmail.com) kirjoitti: > > From: Lev Stipakov > > When DCO is in use, userland doesn't see any traffic > which breaks --inactive option. > > Fix by ad

[Openvpn-devel] [PATCH] Support --inactive option for DCO

2023-03-13 Thread Lev Stipakov
From: Lev Stipakov When DCO is in use, userland doesn't see any traffic which breaks --inactive option. Fix by adding inactivity check to inactivity timeout callback. Get the cumulative tun bytes count (ping packets are excluded) from DCO and compare it to the previous value stored in c2

Re: [Openvpn-devel] [PATCH] dco-linux: implement dco_get_peer_stats{, multi} API

2023-03-21 Thread Lev Stipakov
NAK. When running with --disable-dco: Program received signal SIGUSR2, User defined signal 2. 0x77aee967 in __GI___poll (fds=0x55668ca0, nfds=2, timeout=1) at ../sysdeps/unix/sysv/linux/poll.c:29 29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory. (gdb) c

Re: [Openvpn-devel] [PATCH] multi: don't call DCO APIs if DCO is disabled

2023-03-21 Thread Lev Stipakov
LGTM. Without this patch and with Linux DCO peer stats openvpn crashes, with this patch it doesn't. Acked-by: Lev Stipakov ti 21. maalisk. 2023 klo 12.30 Antonio Quartulli (a...@unstable.cc) kirjoitti: > > The agreement with the DCO submodule is that no API should be called if

[Openvpn-devel] [PATCH] Fix "--inactive 0" behavior for DCO

2023-03-22 Thread Lev Stipakov
From: Lev Stipakov Make sure we exit if is 0 (not set) and no traffic was produced. According to man page and non-DCO --inactive implementation, we exit if amount of bytes produced is less than specified. DCO implementation will do off-by-ones, but we consider it as okay since we don't want

[Openvpn-devel] [PATCH] Print DCO client stats on SIGUSR2

2023-03-22 Thread Lev Stipakov
From: Lev Stipakov Change-Id: I465febdf7ee5fe573e88255844f718efb60f8e8a Signed-off-by: Lev Stipakov --- src/openvpn/sig.c | 13 + src/openvpn/sig.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c index 5b89bb42

Re: [Openvpn-devel] [PATCH] Print DCO client stats on SIGUSR2

2023-03-22 Thread Lev Stipakov
Hi, > While this is expedient, adding dco dependence to parts of code which should > be independent of such inner details look wrong style to me. Finding a way to > keep struct context a const here will lead to a better logic, I think. We have the same approach in multi_print_status(). Not

Re: [Openvpn-devel] [PATCH] Make error in setting metric for IPv6 interface non-fatal

2023-03-22 Thread Lev Stipakov
I reproduced the bug by disabling IPv6 on the DCO adapter and verified that this patch fixes the problem. Code looks obvious enough. Could there be clients with IPv6 enabled and IPv4 disabled? :) Acked-by: Lev Stipakov ke 22. maalisk. 2023 klo 17.16 selva.n...@gmail.com kirjoitti: > >

[Openvpn-devel] [PATCH] Support --inactive option for DCO

2023-03-15 Thread Lev Stipakov
From: Lev Stipakov When DCO is in use, userland doesn't see any traffic which breaks --inactive option. Fix by adding inactivity check to inactivity timeout callback. Get the cumulative tun bytes count (ping packets are excluded) from DCO and compare it to the previous value stored in c2

[Openvpn-devel] [PATCH] Disabe DCO if proxy is set via management

2023-02-20 Thread Lev Stipakov
From: Lev Stipakov DCO doesn't support proxy and we already disable DCO is proxy is set in profile. Signed-off-by: Lev Stipakov --- src/openvpn/init.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index b500d354..7c428307 100644 --- a/src

[Openvpn-devel] [PATCH v2] Disabe DCO if proxy is set via management

2023-02-20 Thread Lev Stipakov
From: Lev Stipakov DCO doesn't support proxy and we already disable DCO is proxy is set in profile. Signed-off-by: Lev Stipakov --- v2: use dco_enabled() helper function src/openvpn/init.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/openvpn/init.c b/src/openvpn/init.c

Re: [Openvpn-devel] [PATCH] Add logging for windows driver selection process

2023-02-17 Thread Lev Stipakov
440710-931B-4719-ACEA-83AEB0430011} Fri Feb 17 15:46:20 2023 Using device interface: \\?\ROOT#NET#0001#{cac88484-7515-4c03-82e6-71a87abac361}\ovpn-dco Fri Feb 17 15:46:20 2023 ovpn-dco device [OpenVPN Data Channel Offload] opened The log level is 6, so normally this is not visible for the users. to

[Openvpn-devel] [PATCH] Avoid management log loop with verb >= 6

2023-02-17 Thread Lev Stipakov
From: Lev Stipakov This log message is printed within check_tls(), which is called by pre_select(), which is called on every iteration of event loop. When management is attached (and doesn't use own event loop), this message sets management state to "wait write", which arms event

[Openvpn-devel] [PATCH] Add logging for windows driver selection process

2023-02-16 Thread Lev Stipakov
From: Lev Stipakov Signed-off-by: Lev Stipakov --- src/openvpn/tun.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 20f80798..a1414d23 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -3705,6 +3705,7

Re: [Openvpn-devel] [PATCH] Use proper print format/casting when converting msg_channel handle

2023-03-01 Thread Lev Stipakov
Hi, Sadly MSVC doesn't show those warnings even on L4. Change looks good. I couldn't (yet) test on x86 since I (hopefully not for long) lost access to the x86 machine, but arm64 works just fine. Acked-by: Lev Stipakov ti 14. helmik. 2023 klo 15.44 Arne Schwabe (a...@rfc2549.org) kirjoitti

Re: [Openvpn-devel] [PATCH] vcpkg: request "tools" feature of openssl for MSVC build

2023-03-30 Thread Lev Stipakov
GHA seems happy about this change: https://github.com/flichtenheld/openvpn/actions/runs/4562871750/jobs/8050638911 Acked-by: Lev Stipakov to 30. maalisk. 2023 klo 13.17 Frank Lichtenheld (fr...@lichtenheld.com) kirjoitti: > > We need this for the MSI build. Previously this was e

<    2   3   4   5   6   7   8   >