Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jun 2013 06:36:26 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r252055 - head/sys/netinet
Message-ID:  <201306210636.r5L6aQUr061014@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Jun 21 06:36:26 2013
New Revision: 252055
URL: http://svnweb.freebsd.org/changeset/base/252055

Log:
  Fix kmod_*stat_inc() after r249276. The incorrect code actually
  increased the pointer, not the memory it points to.
  
  In collaboration with:	kib
  Reported & tested by:	Ian FREISLICH <ianf clue.co.za>
  Sponsored by:		Nginx, Inc.

Modified:
  head/sys/netinet/ip_input.c
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Fri Jun 21 06:28:55 2013	(r252054)
+++ head/sys/netinet/ip_input.c	Fri Jun 21 06:36:26 2013	(r252055)
@@ -283,14 +283,14 @@ void
 kmod_ipstat_inc(int statnum)
 {
 
-	counter_u64_add((counter_u64_t )&V_ipstatp + statnum, 1);
+	counter_u64_add(*((counter_u64_t *)&V_ipstatp + statnum), 1);
 }
 
 void
 kmod_ipstat_dec(int statnum)
 {
 
-	counter_u64_add((counter_u64_t )&V_ipstatp + statnum, -1);
+	counter_u64_add(*((counter_u64_t *)&V_ipstatp + statnum), -1);
 }
 
 static int

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Fri Jun 21 06:28:55 2013	(r252054)
+++ head/sys/netinet/tcp_input.c	Fri Jun 21 06:36:26 2013	(r252055)
@@ -309,7 +309,7 @@ void
 kmod_tcpstat_inc(int statnum)
 {
 
-	counter_u64_add((counter_u64_t )&V_tcpstatp + statnum, 1);
+	counter_u64_add(*((counter_u64_t *)&V_tcpstatp + statnum), 1);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306210636.r5L6aQUr061014>