[Openvpn-devel] foreign_option_2 not set in 2.4

2018-11-21 Thread Cyril Scetbon
Hey guys, I’ve discovered that foreign_option_2 is not set using 2.4.4 but is set using 2.3.10. foreign_option_1=dhcp-option DNS 10.201.50.150 foreign_option_2=dhcp-option DOMAIN cyril.net I had to downgrade to 2.3 because of it. Thanks — Cyril Scetbon __

[Openvpn-devel] [PATCH] Add detection of active VPN connections for MSI packages

2018-11-21 Thread Simon Rozman
This patch adds a simple up/down detection for each TAP interface found. All "up" TAP interface IDs are listed as an `ACTIVETAPINTERFACES` MSI property. This allows MSI packages to test for active VPN connections on updates. --- src/openvpnmsica/Makefile.am| 2 +- src/openvpnmsica/openvpnmsi

[Openvpn-devel] [PATCH v4 07/13] client-connect: Add CC_RET_DEFERRED and cope with deferred client-connect

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel This patch moves the state, that was previously tracked within the multi_connection_established() function, into struct client_connect_state. The multi_connection_established() function can now be exited and re-entered as many times as necessary - without losing the client-c

[Openvpn-devel] [PATCH v4 03/13] client-connect: Move multi_client_connect_setenv into early_setup

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel This patch moves multi_client_connect_setenv into multi_client_connect_early_setup and makes sure that every client-connect handling function updates the virtual address selection. Background: This unifies how the client-connect handling functions work. Signed-off-by: Fabia

[Openvpn-devel] [PATCH v4 02/13] client-connect: Refactor multi_client_connect_source_ccd

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel Refactor multi_client_connect_source_ccd(), so that options_server_import() (or the success path in general) is only entered in one place within the function. Signed-off-by: Fabian Knittel Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 31 +++---

[Openvpn-devel] [PATCH v4 06/13] client-connect: Change connection_established_flag from bool to enum

2018-11-21 Thread Arne Schwabe
This prepares from the yes/no logic to a tristate logic with defered being the third state. This deviates from Fabian's original patch that that used a pointer being NULL or non NULL as implicit third state. Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 14 -- src/openvpn/mul

[Openvpn-devel] [PATCH v4 08/13] client-connect: Add deferred support to the client-connect script handler

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel This patch introduces the concept of a return value file for the client-connect handlers. (This is very similar to the auth value file used during deferred authentication.) The file name is stored in the client_connect_state struct. In addition, the patch also allows the st

[Openvpn-devel] [PATCH v4 00/13] Deferred client-connect patch set

2018-11-21 Thread Arne Schwabe
Fabian submitted the original patch set in 2015. When I started working on it I had quite big rebase conflicts and decided to rebsae it manually. During this rebase I adjusted the code and made other minor and major adjustments to the code to better fit our current code style. The minor adjustments

[Openvpn-devel] [PATCH v4 10/13] client-connect: Also use inotify for the deferred client-connect status file

2018-11-21 Thread Arne Schwabe
As we never do client-connect and authentication at the same time it is safe to reuse the existing fields for client-connect return status file Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/openvpn/mu

[Openvpn-devel] [PATCH v4 04/13] client-connect: Refactor to use return values instead of modifying a passed-in flag

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel This patch changes the way the client-connect helper functions communicate with the main function. Instead of updating cc_succeeded and cc_succeeded_count, they now return either CC_RET_SUCCEEDED, CC_RET_FAILED or CC_RET_SKIPPED. In addition, the client-connect helpers are

[Openvpn-devel] [PATCH v4 01/13] client-connect: Split multi_connection_established into separate functions

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel This patch splits up the multi_connection_established() function. Each new helper function does a specific job. Functions that do a similar job receive a similar calling interface. The patch tries not to reindent code, so that the real changes are as clearly visible as pos

[Openvpn-devel] [PATCH v4 05/13] client-connect: Refactor client-connect handling to calling a bunch of hooks in a loop

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel This patch changes the calling of the client-connect functions into an array of hooks and a block of code that calls them in a loop. Signed-off-by: Fabian Knittel Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 44 1 file

[Openvpn-devel] [PATCH v4 11/13] client-connect: Add deferred support to the client-connect plugin v1 handler

2018-11-21 Thread Arne Schwabe
From: Fabian Knittel Uses the infrastructure provided and used in the previous patch to provide deferral support to the v1 client-connect plugin handler as well. Signed-off-by: Fabian Knittel PATCH V3: Modify the API to also (optionally) call the plugin on a deferred call. This allows the plug

[Openvpn-devel] [PATCH v4 12/13] client-connect: Implement deferred connect support for plugin API v2

2018-11-21 Thread Arne Schwabe
The V2 API is simpler than the V1 API since there is no passing of data via files. This also means that with the current API the V2 API cannot support async notify via files. Adding a file just for async notify seems very hacky and when needed we should implement a better option when async is neede

[Openvpn-devel] [PATCH v4 13/13] client-connect: Add documentation for the deferred client connect feature

2018-11-21 Thread Arne Schwabe
Signed-off-by: Arne Schwabe --- doc/openvpn.8 | 47 ++--- include/openvpn-plugin.h.in | 21 - 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/doc/openvpn.8 b/doc/openvpn.8 index 94b5cc4f..9377bbf5 100644 --- a/doc/openv

[Openvpn-devel] [PATCH v4 09/13] client-connect: Move adding inotify watch into its own function

2018-11-21 Thread Arne Schwabe
This make the code a bit better readable and also prepares resuing the function for client-connect return files Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 46 + 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/openvpn/mult

[Openvpn-devel] [PATCH applied] Re: Remove extra token after #endif

2018-11-21 Thread Gert Doering
Acked-by: Gert Doering Thanks. Regarding Christian's comment about "#endif" vs. "#endif /* ENABLE_CRYPTO /*" - well, we have both in our tree, so neither is "correct" or "wrong". For such a short #ifdef/#endif span, I'd see it as optional because the corresponding #ifdef is easily spotted. For