Hi,

On Fri, Sep 30, 2011 at 11:12:12AM +0200, David Sommerseth wrote:
> On 15/09/11 23:42, Davide Guerri wrote:
> > Please find attached a patch for a new stale-routes-check (and remove)
> > option.
> 
> Applied to the master branch in testing and stable trees.  

The way this is currently implemented breaks compilation with 
--disable-crypto --disable-ssl (glad we have buildbot to test this :) ),
because in that case, P2MP_SERVER is not enabled, and 
options->stale_routes_ageing_time and options->stale_routes_check_interval 
are not defined.

The patch below moves the block inside the #ifdef P2MP_SERVER block
inside options.c - the code is not changed, just moved elsewhere.  

Smoke-tested on FreeBSD 8.2 (just compilation, not even started).

Please verify, ACK, and commit :-)

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 6e7fdb22e361f6c3d0c617b2d633be4dc3e8607a Mon Sep 17 00:00:00 2001
From: Gert Doering <g...@greenie.muc.de>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Sat, 8 Oct 2011 12:26:52 +0200
Subject: [PATCH] move block for "stale-routes-check" config inside #ifdef
 P2MP_SERVER block - options->stale_routes_ageing_time etc.
 are not defined otherwise, and compilation fails.

Signed-off-by: Gert Doering <g...@greenie.muc.de>
---
 options.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/options.c b/options.c
index 68255a5..c1a0ba6 100644
--- a/options.c
+++ b/options.c
@@ -4950,25 +4950,6 @@ add_option (struct options *options,
        }
       options->max_routes = max_routes;
     }
-  else if (streq (p[0], "stale-routes-check") && p[1])
-    {
-      int ageing_time, check_interval;
-
-      VERIFY_PERMISSION (OPT_P_GENERAL);
-      ageing_time = atoi (p[1]);
-      if (p[2])
-        check_interval = atoi (p[2]);
-      else
-        check_interval = ageing_time;
-
-      if (ageing_time < 1 || check_interval < 1)
-        {
-        msg (msglevel, "--stale-routes-check aging time and check interval 
must be >= 1");
-        goto err;
-        }
-      options->stale_routes_ageing_time  = ageing_time;
-      options->stale_routes_check_interval = check_interval;
-    }
   else if (streq (p[0], "route-gateway") && p[1])
     {
       VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS);
@@ -5598,6 +5579,25 @@ add_option (struct options *options,
       VERIFY_PERMISSION (OPT_P_GENERAL);
       options->server_flags |= SF_TCP_NODELAY_HELPER;
     }
+  else if (streq (p[0], "stale-routes-check") && p[1])
+    {
+      int ageing_time, check_interval;
+
+      VERIFY_PERMISSION (OPT_P_GENERAL);
+      ageing_time = atoi (p[1]);
+      if (p[2])
+        check_interval = atoi (p[2]);
+      else
+        check_interval = ageing_time;
+
+      if (ageing_time < 1 || check_interval < 1)
+        {
+        msg (msglevel, "--stale-routes-check aging time and check interval 
must be >= 1");
+        goto err;
+        }
+      options->stale_routes_ageing_time  = ageing_time;
+      options->stale_routes_check_interval = check_interval;
+    }
 #endif /* P2MP_SERVER */
 
   else if (streq (p[0], "client"))
-- 
1.7.7

Attachment: pgpPmiiZsstUY.pgp
Description: PGP signature

Reply via email to