[Openvpn-devel,v2,0/5] Allow IPv6-only tunnels

Message ID 20180608052017.6696-1-a@unstable.cc
Headers show


Antonio Quartulli June 7, 2018, 7:20 p.m. UTC
This patchset allows clients and servers to work with a
tunnel configured with IPv6 only.

Patch 3 is a mere cosmetic change and could be merged
regardless of the rest.

With this change a server can be configured by using only the
'--server-ipv6' directive.
This will result in clients receiving only 'ifconfig-ipv6'
setting in their push-reply (and no IPv4 at all).

Differences from v1:
- more windows logic has been added to ensure client is properly started
  and configured with IPv6 only;
- warning messages added when trying to add IPv4 routes (even when
  redirect-gateway without !ipv4 is specified). Note: the behaviour of
  redirect-gateway has not been touched, therefore the "ipv6" flag is
  still required, even if only IPv6 are configured on the interfaces;
- redirect-gateway is prevented from adding a bypass route if no IPv4
  redirection is taking place;
- added support for --ifconfig-pool-persist when only IPv6 is configured
- added do_ifconfig_ipv4() in do_ifconfig() to make code symmetric wrt
- I may have forgotten some other little details..

(Note: this code is also available at [1] in the ipv6-only branch)


Trac: #208
[1] https://gitlab.com/ordex986/openvpn

Antonio Quartulli (8):
  tun: ensure interface can be configured with IPv6 only
  windows: properly configure TAP driver when no IPv4 is configured
  pool: convert pool 'type' to enum
  pool: allow to configure an IPv6-only ifconfig-pool
  make server capable of starting with an IPv6-only tunnel
  pool: add support for ifconfig-pool-persist with IPv6 only
  route: warn on IPv4 routes installation when no IPv4 is configured
  options: enable IPv4 redirection logic only if really required

 src/openvpn/forward.c |    4 +-
 src/openvpn/helper.c  |    8 +-
 src/openvpn/multi.c   |   10 +-
 src/openvpn/options.c |   16 +-
 src/openvpn/pool.c    |  259 +++++++---
 src/openvpn/pool.h    |   17 +-
 src/openvpn/route.c   |   14 +-
 src/openvpn/tun.c     | 1142 ++++++++++++++++++-----------------------
 src/openvpn/tun.h     |   12 +-
 9 files changed, 754 insertions(+), 728 deletions(-)