Skip to content

Commit

Permalink
allow usage of --server-ipv6 even when no --server is specified
Browse files Browse the repository at this point in the history
Until now OpenVPN has not allowed to specify --server-ipv6
if no --server was also set. This constraint comes from the
fact that most of the IPv6 logic (i.e. ifconfig-pool handling)
relied on IPv4 components to be activated and configured as
well.

Now that the IPv6 code path has been made independent from
IPv4, it is finally possible to to relax the constraint
mentioned above and make it possible for the user to have a
configurations with --server-ipv6 only.

Trac: OpenVPN#208
Signed-off-by: Antonio Quartulli <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg19949.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
ordex authored and cron2 committed Jun 6, 2020
1 parent 4521131 commit 7d65aad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/openvpn/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ helper_client_server(struct options *o)
*/
if (o->server_ipv6_defined)
{
if (!o->server_defined)
if (o->client)
{
msg(M_USAGE, "--server-ipv6 must be used together with --server");
msg(M_USAGE, "--server-ipv6 and --client cannot be used together");
}

if (o->server_flags & SF_NOPOOL)
{
msg( M_USAGE, "--server-ipv6 is incompatible with 'nopool' option" );
Expand All @@ -187,6 +188,9 @@ helper_client_server(struct options *o)
msg( M_USAGE, "--server-ipv6 already defines an ifconfig-ipv6-pool, so you can't also specify --ifconfig-pool explicitly");
}

o->mode = MODE_SERVER;
o->tls_server = true;

/* local ifconfig is "base address + 1" and "+2" */
o->ifconfig_ipv6_local =
print_in6_addr( add_in6_addr( o->server_network_ipv6, 1), 0, &o->gc );
Expand Down

0 comments on commit 7d65aad

Please sign in to comment.