From c55e9562d64f381ba46b83a02503f6239e23d3ef Mon Sep 17 00:00:00 2001 From: Gert Doering Date: Fri, 3 Feb 2012 17:11:03 +0100 Subject: Implement IPv6 interface config with non-/64 prefix lengths. Add "ifconfig_ipv6_netbits_parm" parameter to init_tun(), use that to initialize tt->netbits_ipv6 (previously: always /64). Actual interface setup code already used tt->netbits_ipv6, so no changes needed there. Remove restrictions on "/netbits" value for --server-ipv6 config option (can now be /64.../112, previously had to be exactly /64). Supporting even smaller networks could cause problems with ipv6-pool handling and are only allowed for explicit "ifconfig-ipv6", not for "server-ipv6". Add /netbits to pushed "ifconfig-ipv6" values on server side (client side always accepted this, but ignored it so far, so this does not break compatibility). Tested on Linux/ifconfig, Linux/iproute2 and FreeBSD 7.4 Signed-off-by: Gert Doering Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- options.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index 0fbe368..cb9738a 100644 --- a/options.c +++ b/options.c @@ -2926,6 +2926,7 @@ options_string (const struct options *o, o->ifconfig_local, o->ifconfig_remote_netmask, o->ifconfig_ipv6_local, + o->ifconfig_ipv6_netbits, o->ifconfig_ipv6_remote, (in_addr_t)0, (in_addr_t)0, @@ -5396,9 +5397,9 @@ add_option (struct options *options, msg (msglevel, "error parsing --server-ipv6 parameter"); goto err; } - if ( netbits != 64 ) + if ( netbits < 64 || netbits > 112 ) { - msg( msglevel, "--server-ipv6 settings: only /64 supported right now (not /%d)", netbits ); + msg( msglevel, "--server-ipv6 settings: only /64../112 supported right now (not /%d)", netbits ); goto err; } options->server_ipv6_defined = true; -- cgit