Hi,

On Sun, Jan 20, 2013 at 04:49:51PM +0100, Marcel Pennewiß wrote:
> > in time for 2.3, one of the remaining open itches for the IPv6 code 
> > is now fixed :-)  (and the changes needed turned out to be fairly
> > trivial).
> 
> Using ifconfig-ipv6-pool instead of server-ipv6(-macro) does not allow
> non-/64 prefix (in current 2.3). Bug or Feature?

Smells buggy.  As server-ipv6 is just a macro (not really, but sort of).

Indeed... options.c:

  else if (streq (p[0], "ifconfig-ipv6-pool") && p[1] )
...
      if ( netbits != 64 )
        {
          msg( msglevel, "--ifconfig-ipv6-pool settings: only /64 supported righ
t now (not /%d)", netbits );
          goto err;
        }

... this is a leftover from the initial days, where nothing else was
supported (not for server-ipv6 either).

Patch is trivial, please find attached.  David: 2.3.1 and 2.4.0, please :-)

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de
From cdfbc8952a01acde0eedf08fa0ebefed38fa2763 Mon Sep 17 00:00:00 2001
From: Gert Doering <g...@greenie.muc.de>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Sun, 20 Jan 2013 20:50:38 +0200
Subject: [PATCH] Permit pool size of /64.../112 for ifconfig-ipv6-pool

(Leftover check from the early days where --server-ipv6 also only
accepted /64 - nowadays we handle smaller pools just fine)

Signem-off-by: Gert Doering <g...@greenie.muc.de>
---
 src/openvpn/options.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 8ca41a3..1d89e4b 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -5484,9 +5484,9 @@ add_option (struct options *options,
          msg (msglevel, "error parsing --ifconfig-ipv6-pool parameters");
          goto err;
        }
-      if ( netbits != 64 )
+      if ( netbits < 64 || netbits > 112 )
        {
-         msg( msglevel, "--ifconfig-ipv6-pool settings: only /64 supported 
right now (not /%d)", netbits );
+         msg( msglevel, "--ifconfig-ipv6-pool settings: only /64../112 
supported right now (not /%d)", netbits );
          goto err;
        }
 
-- 
1.7.3.5

Attachment: pgpluBHBLkzV3.pgp
Description: PGP signature

Reply via email to