]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix parameter listing in non-debug builds at verb 4
authorJosh Cepek <josh.cepek@usa.net>
Thu, 21 Feb 2013 15:50:38 +0000 (09:50 -0600)
committerGert Doering <gert@greenie.muc.de>
Thu, 14 Mar 2013 15:38:09 +0000 (16:38 +0100)
When built with enable_debug=no, the parameter output expected at --verb
4 is not printed due to use of #ifdef ENABLE_DEBUG in the responsible
code sections. This appears to be a mistake when looking at the
configure help text for enable_small and enable_debug.

This change keys the relevant code off of enable_small instead,
including the parameter listing when enale_small=no (the
configure-script default.) Most of this code is in options.c, with some
callers present in plugin.c/h and route.c/h. No function code is
changed, just the #ifdef values to use the small feature instead of
debug.

This means builds no longer need enable_debug=yes in order to get the
expected log output at verb 4.

Signed-off-by: Josh Cepek <josh.cepek@usa.net>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <437RBuq1U8032S07.1361465626@web07.cms.usa.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7361
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c
src/openvpn/plugin.c
src/openvpn/plugin.h
src/openvpn/route.c
src/openvpn/route.h

index 8857ed8d2f87235ba7f66c6728e553e0071aab63..2eb4f91c2874e951eb79cf02e933be39c01303b6 100644 (file)
@@ -881,7 +881,7 @@ uninit_options (struct options *o)
     }
 }
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 
 #define SHOW_PARM(name, value, format) msg(D_SHOW_PARMS, "  " #name " = " format, (value))
 #define SHOW_STR(var)       SHOW_PARM(var, (o->var ? o->var : "[UNDEF]"), "'%s'")
@@ -1081,7 +1081,7 @@ parse_hash_fingerprint(const char *str, int nbytes, int msglevel, struct gc_aren
 
 #ifdef WIN32
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 
 static void
 show_dhcp_option_addrs (const char *name, const in_addr_t *array, int len)
@@ -1153,7 +1153,7 @@ dhcp_option_address_parse (const char *name, const char *parm, in_addr_t *array,
 
 #if P2MP
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 
 static void
 show_p2mp_parms (const struct options *o)
@@ -1225,7 +1225,7 @@ show_p2mp_parms (const struct options *o)
   gc_free (&gc);
 }
 
-#endif /* ENABLE_DEBUG */
+#endif /* ! ENABLE_SMALL */
 
 #if P2MP_SERVER
 
@@ -1279,7 +1279,7 @@ option_iroute_ipv6 (struct options *o,
 #endif /* P2MP_SERVER */
 #endif /* P2MP */
 
-#if defined(ENABLE_HTTP_PROXY) && defined(ENABLE_DEBUG)
+#if defined(ENABLE_HTTP_PROXY) && !defined(ENABLE_SMALL)
 static void
 show_http_proxy_options (const struct http_proxy_options *o)
 {
@@ -1332,7 +1332,7 @@ cnol_check_alloc (struct options *options)
 }
 #endif
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 static void
 show_connection_entry (const struct connection_entry *o)
 {
@@ -1400,7 +1400,7 @@ show_connection_entries (const struct options *o)
 void
 show_settings (const struct options *o)
 {
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
   msg (D_SHOW_PARMS, "Current Parameter Settings:");
 
   SHOW_STR (config);
index 83f79e4fd31bdbd4b1a411022b76041ab58fa6c2..c96c121f21aaa5aa5562421a326c8b17c88ec6f2 100644 (file)
@@ -155,7 +155,7 @@ plugin_option_list_add (struct plugin_option_list *list, char **p, struct gc_are
     return false;
 }
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 void
 plugin_option_list_print (const struct plugin_option_list *list, int msglevel)
 {
index 4ba150d637a7d49b745e51762ca7d941bf8dfac2..2f8416b10e93dad5a9911f96e89130f4ada37fee 100644 (file)
@@ -108,7 +108,7 @@ struct plugin_return
 struct plugin_option_list *plugin_option_list_new (struct gc_arena *gc);
 bool plugin_option_list_add (struct plugin_option_list *list, char **p, struct gc_arena *gc);
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 void plugin_option_list_print (const struct plugin_option_list *list, int msglevel);
 #endif
 
index dd69d8ed001c9a1c5b57ccfb77cdc82096d52cdb..134ed58e4f2d8af6b78a7b8b87846fae320960df 100644 (file)
@@ -1089,7 +1089,7 @@ delete_routes (struct route_list *rl, struct route_ipv6_list *rl6,
     }
 }
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 
 static const char *
 show_opt (const char *option)
index e63db595dc2fd67b7f24a2b3066e0f916a8446af..a40de32f00e74003485a194fcd7171917d44744a 100644 (file)
@@ -290,7 +290,7 @@ void print_default_gateway(const int msglevel, const struct route_gateway_info *
 #define TLA_LOCAL           2
 int test_local_addr (const in_addr_t addr, const struct route_gateway_info *rgi);
 
-#ifdef ENABLE_DEBUG
+#ifndef ENABLE_SMALL
 void print_route_options (const struct route_option_list *rol,
                          int level);
 #endif