[Openvpn-devel] [PATCH 09/10] Fix IPv6 host routes to LAN gateway on OpenSolaris

2015-09-11 Thread Gert Doering
The tun/tap routes need to be set with "metric 0", while this will prevent routes to LAN gateways from being installed. So, set metric 0 only if no other interface is requested... (Note: OpenSolaris can not specify host+interface gateways, so we just use the GW addresses - it seems to still work

[Openvpn-devel] Route-Gateway redirection for IPv6 - finally

2015-09-11 Thread Gert Doering
Hi, this is the block of code that is missing for 2.4 on the IPv6/routing side (correctly handle IPv6 routes that overlap with the IPv6 address of the VPN server) - if it's in, I'm ready to go... 01+02 are refactoring without functional code changes, to make the IPv6 data structures more similar

[Openvpn-devel] [PATCH 03/10] Add route_ipv6_gateway* data structures for rgi6 support.

2015-09-11 Thread Gert Doering
route_gateway_address -> route_ipv6_gateway_address route_gateway_info-> route_ipv6_gateway_info Signed-off-by: Gert Doering --- src/openvpn/route.h | 28 1 file changed, 28 insertions(+) diff --git a/src/openvpn/route.h b/src/openvpn/route.h index 7e96a2f..5ab5

[Openvpn-devel] [PATCH 07/10] Implement '--redirect-gateway ipv6'

2015-09-11 Thread Gert Doering
Add "ipv6" and "!ipv4" sub-options to "--redirect-gateway" option. This is done in the same way as in the OpenVPN 3 code base, so "--redirect-gateway ipv6" will redirect both IPv4 and IPv6 - if you want v6-only, use "--redirect-gateway ipv6 !ipv4". The actual implementation is much simpler than f

[Openvpn-devel] [PATCH 02/10] refactor struct route_ipv6_list, bring in line with struct route_list again

2015-09-11 Thread Gert Doering
adjust "struct route_ipv6_list" (and all users) to reflect changes to "struct route_list" done in commit 7fb0e07e, namely: - new member "rl6->iflags"(RL_* flags) - new member "rl6->spec_flags"(RTSA_* flags) - new member "rl6->remote_host_ipv6" (--remote address we're talkin

[Openvpn-devel] [PATCH 05/10] get_default_gateway_ipv6(): Linux / Netlink implementation.

2015-09-11 Thread Gert Doering
Signed-off-by: Gert Doering --- src/openvpn/route.c | 147 +++- 1 file changed, 135 insertions(+), 12 deletions(-) diff --git a/src/openvpn/route.c b/src/openvpn/route.c index fd8209d..cca5cfe 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/rout

[Openvpn-devel] [PATCH 10/10] get_default_gateway_ipv6(): Win32 implementation using GetBestRoute2()

2015-09-11 Thread Gert Doering
To get access to that functionality, bump Windows API level for MinGW compilation from NTDDI_WINXP/_WIN32_WINNT_WINXP to ..._VISTA, and shuffle around WIN32 includes a bit in syshead.h MinGW 32 seems to be broken regarding MIB_TCP_STATE enum, so add typedef for that - surrounding #ifdefs found by

[Openvpn-devel] [PATCH 01/10] refactor struct route_ipv6, bring in line with struct route_ipv4 again

2015-09-11 Thread Gert Doering
adjust "struct route_ipv6" (and all users) to reflect changes to "struct route_ipv4" done in commit 7fb0e07e, namely: - new member "r6->flags" - "r6->defined"becomes "r6->flags & RT_DEFINED" - "r6->metric_defined" becomes "r6->flags & RT_METRIC_DEFINED" - route addition status is store

[Openvpn-devel] [PATCH 04/10] Create basic infrastructure for IPv6 default gateway handling / redirection.

2015-09-11 Thread Gert Doering
- introduce get_default_gateway_ipv6() and add stub functions with the implementation plan to the 4 major code blocks here (Windows, Linux/Android, *BSD and Solaris, "others") - add &rgi6 to print_default_gateway(), and teach it to print v4, v6 or both, depending on the calling environment

[Openvpn-devel] [PATCH 08/10] get_default_gateway_ipv6(): *BSD / MacOS / Solaris PF_ROUTE implementation

2015-09-11 Thread Gert Doering
As for IPv4, a common implementation for all (supported) BSD families and Solaris. Supporting the latter requires separate implementations for IPv4 and IPv6, unfortunately, so it's quite a bit of duplicate code. Further, extend add_route_ipv6() and delete_route_ipv6() to handle link-local gateway

[Openvpn-devel] [PATCH 06/10] Implement handling of overlapping IPv6 routes with IPv6 remote VPN server address

2015-09-11 Thread Gert Doering
- socket.[ch]: add link_socket_current_remote_ipv6() helper to extract current address of remote VPN server (if IPv6, NULL otherwise), IPv6 equivalent to link_socket_current_remote() - init.c: pass remote VPN server address to init_route_ipv6_list() (link_socket_current_remote_ipv6()) -