Browse code

Push an IPv6 CIDR mask used by the server, not the pool's size

Correctly handle CIDR masks when pushing clients addressing from an IPv6
pool. This change ignores the incorrectly used `bits` argument to the
--ifconfig-ipv6-pool option.

The code to save any provided CIDR mask after the pool IP is left in;
this may someday become useful when we move to allow IPv6 pools without
relying on an IPv4 pool assignment.

Signed-off-by: Josh Cepek <josh.cepek@usa.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <53F1DA95.7020701@usa.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8990
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Josh Cepek authored on 2014/08/18 19:51:01
Showing 2 changed files
... ...
@@ -5799,10 +5799,7 @@ Is only accepted if ``\-\-mode server'' or ``\-\-server'' is set.
5799 5799
 Specify an IPv6 address pool for dynamic assignment to clients.  The
5800 5800
 pool starts at
5801 5801
 .B ipv6addr
5802
-and increments by +1 for every new client (linear mode).  The
5803
-.B /bits
5804
-setting controls the size of the pool.  Due to implementation details,
5805
-the pool size must be between /64 and /112.
5802
+and matches the offset determined from the start of the IPv4 pool.
5806 5803
 .TP
5807 5804
 .B \-\-ifconfig\-ipv6\-push ipv6addr/bits ipv6remote
5808 5805
 for ccd/ per-client static IPv6 interface configuration, see
... ...
@@ -1431,10 +1431,10 @@ multi_select_virtual_addr (struct multi_context *m, struct multi_instance *mi)
1431 1431
 	  if ( mi->context.options.ifconfig_ipv6_pool_defined )
1432 1432
 	    {
1433 1433
 	      mi->context.c2.push_ifconfig_ipv6_local = remote_ipv6;
1434
-	      mi->context.c2.push_ifconfig_ipv6_remote = 
1434
+	      mi->context.c2.push_ifconfig_ipv6_remote =
1435 1435
 		    mi->context.c1.tuntap->local_ipv6;
1436
-	      mi->context.c2.push_ifconfig_ipv6_netbits = 
1437
-		    mi->context.options.ifconfig_ipv6_pool_netbits;
1436
+	      mi->context.c2.push_ifconfig_ipv6_netbits =
1437
+		    mi->context.options.ifconfig_ipv6_netbits;
1438 1438
 	      mi->context.c2.push_ifconfig_ipv6_defined = true;
1439 1439
 	    }
1440 1440
 	}