All of lore.kernel.org
 help / color / mirror / Atom feed
* [Openvpn-devel] [PATCH] Make use of counter_type instead of int when counting bytes and network packets
@ 2010-04-08 19:22 David Sommerseth
  2010-04-08 19:35 ` Gert Doering
  2010-04-08 19:41 ` David Sommerseth
  0 siblings, 2 replies; 3+ messages in thread
From: David Sommerseth @ 2010-04-08 19:22 UTC (permalink / raw)
  To: openvpn-devel@lists.sourceforge.net

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

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

This is in response to a reported Debian bug, where the connection
counter overflows.
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576827>

Signed-off-by: David Sommerseth <dazo@...384...>
- ---
 ssl.c |    3 ++-
 ssl.h |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAku+LQ4ACgkQDC186MBRfrpafwCfTukA6Sck9ya7N9+miRq8vD7e
+1cAoJEnTjfdrEJAy+KDDq4pgWqTKkeW
=a8Yb
-----END PGP SIGNATURE-----

[-- Attachment #2: 0001-Make-use-of-counter_type-instead-of-int-when-countin.patch --]
[-- Type: text/plain, Size: 1932 bytes --]

From 5c383c4445598cddaaf9b0568065e07dc1275c4e Mon Sep 17 00:00:00 2001
From: David Sommerseth <dazo@...384...>
Date: Thu, 8 Apr 2010 21:18:42 +0200
Subject: [PATCH] Make use of counter_type instead of int when counting bytes and network packets

This is in response to a reported Debian bug, where the connection counter overflows.
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576827>

Signed-off-by: David Sommerseth <dazo@...384...>
---
 ssl.c |    3 ++-
 ssl.h |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ssl.c b/ssl.c
index 1b275af..ddd5ee7 100644
--- a/ssl.c
+++ b/ssl.c
@@ -3747,7 +3747,8 @@ tls_process (struct tls_multi *multi,
 	   && ks->n_packets >= session->opt->renegotiate_packets)
        || (packet_id_close_to_wrapping (&ks->packet_id.send))))
     {
-      msg (D_TLS_DEBUG_LOW, "TLS: soft reset sec=%d bytes=%d/%d pkts=%d/%d",
+      msg (D_TLS_DEBUG_LOW,
+           "TLS: soft reset sec=%d bytes=" counter_format "/%d pkts=" counter_format "/%d",
 	   (int)(ks->established + session->opt->renegotiate_seconds - now),
 	   ks->n_bytes, session->opt->renegotiate_bytes,
 	   ks->n_packets, session->opt->renegotiate_packets);
diff --git a/ssl.h b/ssl.h
index 9737f26..f3f76c4 100644
--- a/ssl.h
+++ b/ssl.h
@@ -376,8 +376,8 @@ struct key_state
   struct reliable *rec_reliable;  /* order incoming ciphertext packets before we pass to TLS */
   struct reliable_ack *rec_ack;	  /* buffers all packet IDs we want to ACK back to sender */
 
-  int n_bytes;			 /* how many bytes sent/recvd since last key exchange */
-  int n_packets;		 /* how many packets sent/recvd since last key exchange */
+  counter_type n_bytes;		 /* how many bytes sent/recvd since last key exchange */
+  counter_type n_packets;	 /* how many packets sent/recvd since last key exchange */
 
   /*
    * If bad username/password, TLS connection will come up but 'authenticated' will be false.
-- 
1.6.6.1


[-- Attachment #3: 0001-Make-use-of-counter_type-instead-of-int-when-countin.patch.sig --]
[-- Type: application/pgp-signature, Size: 72 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Openvpn-devel] [PATCH] Make use of counter_type instead of int when counting bytes and network packets
  2010-04-08 19:22 [Openvpn-devel] [PATCH] Make use of counter_type instead of int when counting bytes and network packets David Sommerseth
@ 2010-04-08 19:35 ` Gert Doering
  2010-04-08 19:41 ` David Sommerseth
  1 sibling, 0 replies; 3+ messages in thread
From: Gert Doering @ 2010-04-08 19:35 UTC (permalink / raw)
  To: David Sommerseth <openvpn.list@; +Cc: openvpn-devel@lists.sourceforge.net

Hi,

On Thu, Apr 08, 2010 at 09:22:54PM +0200, David Sommerseth wrote:
> This is in response to a reported Debian bug, where the connection
> counter overflows.
> <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576827>
[..]
>      {
> -      msg (D_TLS_DEBUG_LOW, "TLS: soft reset sec=%d bytes=%d/%d pkts=%d/%d",
> +      msg (D_TLS_DEBUG_LOW,
> +           "TLS: soft reset sec=%d bytes=" counter_format "/%d pkts=" counter_format "/%d",
>  	   (int)(ks->established + session->opt->renegotiate_seconds - now),
[..]
> -  int n_bytes;			 /* how many bytes sent/recvd since last key exchange */
> -  int n_packets;		 /* how many packets sent/recvd since last key exchange */
> +  counter_type n_bytes;		 /* how many bytes sent/recvd since last key exchange */
> +  counter_type n_packets;	 /* how many packets sent/recvd since last key exchange */

ACK, this looks good.  The "counter_type" and "counter_format" infrastructure
will give 64-bit counters with portability to whatever systems supports
64 bit - and fallback to 32 bit where it is not possible.

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert@...1296...
fax: +49-89-35655025                        gert@...1297...


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Openvpn-devel] [PATCH] Make use of counter_type instead of int when counting bytes and network packets
  2010-04-08 19:22 [Openvpn-devel] [PATCH] Make use of counter_type instead of int when counting bytes and network packets David Sommerseth
  2010-04-08 19:35 ` Gert Doering
@ 2010-04-08 19:41 ` David Sommerseth
  1 sibling, 0 replies; 3+ messages in thread
From: David Sommerseth @ 2010-04-08 19:41 UTC (permalink / raw)
  To: openvpn-devel@lists.sourceforge.net

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

On 08/04/10 21:22, David Sommerseth wrote:
> This is in response to a reported Debian bug, where the connection
> counter overflows.
> <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576827>
> 
> Signed-off-by: David Sommerseth <dazo@...384...>
> ---
>  ssl.c |    3 ++-
>  ssl.h |    4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)

Applied to the openvpn-testing.git bugfix2.1 branch.  To be merged into
allmerged soon.
Commit 5acb71a0aab49e10233bcfbc84c6c4685cb93f9d


Kind regards,

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

iEYEARECAAYFAku+MXoACgkQDC186MBRfroLBwCghCrrheZ0Mm5oDTqLDAOGOUOw
6u8AoIJJYLn0nn+tejE6QQLRDx3oAgdX
=jVBz
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-08 19:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 19:22 [Openvpn-devel] [PATCH] Make use of counter_type instead of int when counting bytes and network packets David Sommerseth
2010-04-08 19:35 ` Gert Doering
2010-04-08 19:41 ` David Sommerseth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.