[Openvpn-devel] Replace M_DEBUG with D_LOW as the former is too verbose

Message ID 1528229170-6175-1-git-send-email-selva.nair@gmail.com
State Accepted
Headers show
Series [Openvpn-devel] Replace M_DEBUG with D_LOW as the former is too verbose | expand

Commit Message

Selva Nair June 5, 2018, 10:06 a.m. UTC
From: Selva Nair <selva.nair@gmail.com>

M_DEBUG only indicates the type of the message and will print even
at verb 0.  Use D_LOW which is M_DEBUG combined with verb = 4 and
a mute level.

---
Moving towards what the man page says:
   verb 0 means "No output except fatal errors."

M_WARN also needs replacement but that one is more pervasive and
needs more care. 

 src/openvpn/ssl_openssl.c | 2 +-
 src/openvpn/tun.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Gert Doering June 8, 2018, 4:01 a.m. UTC | #1
Hi,

On Tue, Jun 05, 2018 at 04:06:10PM -0400, selva.nair@gmail.com wrote:
> From: Selva Nair <selva.nair@gmail.com>
> 
> M_DEBUG only indicates the type of the message and will print even
> at verb 0.  Use D_LOW which is M_DEBUG combined with verb = 4 and
> a mute level.

This does not want to apply for me - the tun.c hunk says "apply at
line 1043", but the line in question is in line 893, and the
context is different.

I assume this was on top of Antonio's v6-only 1/5?

OTOH this is trivial enough... I think the patch makes sense, it will
inevitably create a conflict with Antonio's v2 1/8, so I'll just 
mangle the patch by hand.

gert
Gert Doering June 8, 2018, 4:20 a.m. UTC | #2
Your patch has been applied to the master and release/2.4 branch
(I consider this a bugfix, as "someone" just didn't understand that
M_DEBUG is not for what it sounds it is - D_LOW makes sense)

commit 68441882e55b8e6c3c55a4078fbfdd76c7ada6bc (master)
commit 935d17062f68868fe922bbc446476b4de6fa3d45 (release/2.4)
Author: Selva Nair
Date:   Tue Jun 5 16:06:10 2018 -0400

     Replace M_DEBUG with D_LOW as the former is too verbose

     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <1528229170-6175-1-git-send-email-selva.nair@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16964.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Selva Nair June 8, 2018, 4:50 a.m. UTC | #3
Hi,

On Fri, Jun 8, 2018 at 10:01 AM Gert Doering <gert@greenie.muc.de> wrote:
>
> Hi,
>
> On Tue, Jun 05, 2018 at 04:06:10PM -0400, selva.nair@gmail.com wrote:
> > From: Selva Nair <selva.nair@gmail.com>
> >
> > M_DEBUG only indicates the type of the message and will print even
> > at verb 0.  Use D_LOW which is M_DEBUG combined with verb = 4 and
> > a mute level.
>
> This does not want to apply for me - the tun.c hunk says "apply at
> line 1043", but the line in question is in line 893, and the
> context is different.
>
> I assume this was on top of Antonio's v6-only 1/5?
>
> OTOH this is trivial enough... I think the patch makes sense, it will
> inevitably create a conflict with Antonio's v2 1/8, so I'll just
> mangle the patch by hand.

You are right, based on wrong branch. Sorry about that. And, thanks.

Selva

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

Patch

diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
index 8ef68eb..527a600 100644
--- a/src/openvpn/ssl_openssl.c
+++ b/src/openvpn/ssl_openssl.c
@@ -622,7 +622,7 @@  tls_ctx_load_ecdh_params(struct tls_root_ctx *ctx, const char *curve_name
 
     EC_KEY_free(ecdh);
 #else  /* ifndef OPENSSL_NO_EC */
-    msg(M_DEBUG, "Your OpenSSL library was built without elliptic curve support."
+    msg(D_LOW, "Your OpenSSL library was built without elliptic curve support."
         " Skipping ECDH parameter loading.");
 #endif /* OPENSSL_NO_EC */
 }
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 2e33880..688a920 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -1043,7 +1043,7 @@  do_ifconfig(struct tuntap *tt,
         const char *ifconfig_broadcast = NULL;
         struct argv argv = argv_new();
 
-        msg( M_DEBUG, "do_ifconfig, tt->did_ifconfig_ipv6_setup=%d",
+        msg( D_LOW, "do_ifconfig, tt->did_ifconfig_ipv6_setup=%d",
              tt->did_ifconfig_ipv6_setup );
 
         /*