Re: [Openvpn-devel] [PATCH 2/8] implement networking API for iproute2

2018-04-20 Thread Antonio Quartulli
Hi, there is one little "open" thing in this patch that I wanted to highlight. See below: On 20/04/18 19:16, Antonio Quartulli wrote: > +static struct env_set *es = NULL; > + . > +openvpn_execve_check(&argv, es, S_FATAL, "Linux ip link set failed"); Right now the code initializing the e

Re: [Openvpn-devel] [Patch] Support client reason from auth plugin

2018-04-20 Thread Selva Nair
Hi On Fri, Apr 20, 2018 at 4:00 AM, Gert Doering wrote: > Hi, > > On Fri, Apr 20, 2018 at 03:20:26PM +1000, Eric Thorpe wrote: >> This patch allows for a client reason to be returned from an auth plugin >> and sent to the connecting client on an auth fail. This change is >> backwards compatible w

[Openvpn-devel] [PATCH 5/8] introduce sitnl: Simplified Interface To NetLink

2018-04-20 Thread Antonio Quartulli
This patch introduces a tiny netlink interface, optimized for the openvpn use case. It basically exposes all those operations that are currently handled by directly calling the /sbin/ip command (or even ifconfig/route, if configured). By using netlink, openvpn won't need to spawn new processes wh

[Openvpn-devel] [PATCH 6/8] configure: don't check for route/ifconfig on linux

2018-04-20 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 626b4dd4..98be7243 100644 --- a/configure.ac +++ b/configure.ac @@ -298,6 +298,7 @@ case "$host" in *-*-linux*) AC_DEFI

[Openvpn-devel] [PATCH 7/8] route.c: use sitnl to implement get_default_gateway_ipv6()

2018-04-20 Thread Antonio Quartulli
get_default_gateway_ipv6() has always been implemented using netlink, however, now that we have sitnl, we can re-use the latter and get rid of the netlink code from route.c. Signed-off-by: Antonio Quartulli --- src/openvpn/networking_ip.c | 2 +- src/openvpn/route.c | 150 +++--

[Openvpn-devel] [PATCH 4/8] route.c: use new networking API to handle routing table on Linux

2018-04-20 Thread Antonio Quartulli
By switching to the networking API (for Linux) openvpn will now use any of the available implementations to handle the routing table. At the moment only iproute2 is implemented. Signed-off-by: Antonio Quartulli --- src/openvpn/networking_ip.c | 1 - src/openvpn/route.c | 214 +

[Openvpn-devel] [PATCH 0/4] add netlink support for Linux

2018-04-20 Thread Antonio Quartulli
Hi all, finally this is the first "real" patchset that introduces native netlink support for the Linux platform. - Description: At the moment openvpn operates on the tun interface and on the routing table by directly invoking the "ip" command (or ifconfig/route if nettools is selected at compile

[Openvpn-devel] [PATCH 8/8] unit tests: implement test for sitnl

2018-04-20 Thread Antonio Quartulli
This patch introduces a new unit test that is not executed by the cmocka framework, but rather used by a new t_net.sh bash script. The idea behind this test is to ensure that invoking sitnl functions or running iproute commands leads to the same networking (interface and routing table) state. To

[Openvpn-devel] [PATCH 3/8] tun.c: use new networking API to handle tun interface on Linux

2018-04-20 Thread Antonio Quartulli
By switching to the networking API (for Linux) openvpn will now use any of the available implementations to handle the tun interface. At the moment only iproute2 is implemented. Signed-off-by: Antonio Quartulli --- src/openvpn/tun.c | 199 ++ 1 file c

[Openvpn-devel] [PATCH 2/8] implement networking API for iproute2

2018-04-20 Thread Antonio Quartulli
iproute2 is the first user of the new networking API and its one of the two currently supported functionalities on Linux (the other being net-tools). This patch simply copies the current code from tun.c/route.c to networking_ip.c without introducing any funcional change to the code. Signed-off-by

[Openvpn-devel] [PATCH 1/8] implement platform generic networking API

2018-04-20 Thread Antonio Quartulli
tun.c and route.c contain all the code used by openvpn to manage the tun interface and the routing table on all the supported platforms. Across the years, this resulted in a longer functions and series of ifdefs. This patch introduces a new "networking API" which aims at creating a simple abstrac

Re: [Openvpn-devel] [Patch] Support client reason from auth plugin

2018-04-20 Thread Gert Doering
Hi, On Fri, Apr 20, 2018 at 03:20:26PM +1000, Eric Thorpe wrote: > This patch allows for a client reason to be returned from an auth plugin > and sent to the connecting client on an auth fail. This change is > backwards compatible with existing plugins and hasn't caused issues with > existing p