Skip to contentSkip to conversation

verb 5 logging wrongly reports received bytes

PATCH Applied David Sommerseth 2 participants 3 messages Feb 19, 2010 – Feb 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 verb 5 logging wrongly reports received bytes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

With --verb 5, openvpn logs a single letter (rwRW) for each package received or sent. I recently ran into a problem with the tun device on Linux where the read from that device returned 0. Unfortunately this was also logged as "r", which made me assume that openvpn had received something, while it actually hadn't.

(See https://dev.openwrt.org/ticket/6650 for the bug that made me find out about this problem with openvpn.)

I'm attaching a patch which prevents openvpn from logging "r" or "R" when it didn't actually read anything. This is against openvpn 2.1-rc20, but probably still applies to the most recent version.

This patch was received anonymously via the sf.net bug tracker:
<http://sourceforge.net/tracker/?func=detail&atid=454719&aid=2951003&group_id=48978>

- ----------------------------------------------------------------------

ACK

Patch looks sensible, and applies cleanly to the master branch.

David S.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkt+vlgACgkQDC186MBRfrpB7gCfTmXPEVEGBD/Yn2UxVqocauNs GgoAn1NKXihdqr6HnZRfH0DEd4iDBRdG
=nKYU
-----END PGP SIGNATURE-----

From 0827641faed01bb53ec94c996f7a2f5133549b1d Mon Sep 17 00:00:00 2001
From: David Sommerseth <[email protected]...>
Date: Fri, 19 Feb 2010 17:32:56 +0100
Subject: [PATCH] verb 5 logging wrongly reports received bytes

With --verb 5, openvpn logs a single letter (rwRW) for each package received or sent. I recently ran into a problem with the tun device on Linux where the read from that device returned 0. Unfortunately this was also logged as "r", which made me assume that openvpn had received something, while it actually hadn't.

(See https://dev.openwrt.org/ticket/6650 for the bug that made me find out about this problem with openvpn.)

I'm attaching a patch which prevents openvpn from logging "r" or "R" when it didn't actually read anything. This is against openvpn 2.1-rc20, but probably still applies to the most recent version.

This patch was received anonymously via the sf.net bug tracker:
<http://sourceforge.net/tracker/?func=detail&atid=454719&aid=2951003&group_id=48978>

---
 forward.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
forward.c +2 -2
index 207b876..d563e11 100644
@@ -755,7 +755,7 @@ process_incoming_link (struct context *c)
 
   /* log incoming packet */
 #ifdef LOG_RW
-  if (c->c2.log_rw)
+  if (c->c2.log_rw && c->c2.buf.len > 0)
     fprintf (stderr, "R");
 #endif
   msg (D_LINK_RW, "%s READ [%d] from %s: %s",
@@ -965,7 +965,7 @@ process_incoming_tun (struct context *c)
     c->c2.tun_read_bytes += c->c2.buf.len;
 
 #ifdef LOG_RW
-  if (c->c2.log_rw)
+  if (c->c2.log_rw && c->c2.buf.len > 0)
     fprintf (stderr, "r");
 #endif
 
Signature · 1 line
1.6.6
#1 lore raw

Hi,

Quoted 3 lines · David Sommerseth

ACK

Patch looks sensible, and applies cleanly to the master branch.

ACK. I can see the reason for doing so (as I'll have a device "soon"
that will return 0 from tun device reads under certain circumstances) and it doesn't break current usage.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
author Acked-by Acked-by Gert Doering on v1 1/1 Applied
#2 lore raw
In reply to David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 16 lines · David Sommerseth

With --verb 5, openvpn logs a single letter (rwRW) for each package received or sent. I recently ran into a problem with the tun device on Linux where the read from that device returned 0. Unfortunately this was also logged as "r", which made me assume that openvpn had received something, while it actually hadn't.

(See https://dev.openwrt.org/ticket/6650 for the bug that made me find out about this problem with openvpn.)

I'm attaching a patch which prevents openvpn from logging "r" or "R" when it didn't actually read anything. This is against openvpn 2.1-rc20, but probably still applies to the most recent version.

This patch was received anonymously via the sf.net bug tracker:
<http://sourceforge.net/tracker/?func=detail&atid=454719&aid=2951003&group_id=48978>

Quoted 8 lines

----------------------------------------------------------------------

ACK

Patch looks sensible, and applies cleanly to the master branch.

David S.

Applied to bugfix2.1 branch, merged into allmerged.

commit 228c8b0f1e843e799251adb744f7066d983b2385

kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkuCj5IACgkQDC186MBRfrranwCaAjRQiSB/Jq53EIFH7nuvq1nq CgQAoILKL8eG9garRXj/vqp4617kHQnc
=AKOc
-----END PGP SIGNATURE-----