From owner-svn-src-head@FreeBSD.ORG Fri Jun 21 06:36:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F1DCCD15; Fri, 21 Jun 2013 06:36:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E475B1C46; Fri, 21 Jun 2013 06:36:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5L6aQbf061016; Fri, 21 Jun 2013 06:36:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5L6aQUr061014; Fri, 21 Jun 2013 06:36:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201306210636.r5L6aQUr061014@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 21 Jun 2013 06:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252055 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jun 2013 06:36:27 -0000 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 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); } /*