From owner-svn-src-projects@FreeBSD.ORG Sat Feb 25 09:14:17 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA691106564A; Sat, 25 Feb 2012 09:14:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9A938FC08; Sat, 25 Feb 2012 09:14:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1P9EH7G009291; Sat, 25 Feb 2012 09:14:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1P9EHew009289; Sat, 25 Feb 2012 09:14:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202250914.q1P9EHew009289@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 25 Feb 2012 09:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232148 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2012 09:14:17 -0000 Author: glebius Date: Sat Feb 25 09:14:17 2012 New Revision: 232148 URL: http://svn.freebsd.org/changeset/base/232148 Log: Re-do r232062 not abusing variable name. Submitted by: bde Modified: projects/pf/head/sys/contrib/pf/net/pf_norm.c Modified: projects/pf/head/sys/contrib/pf/net/pf_norm.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_norm.c Sat Feb 25 08:01:29 2012 (r232147) +++ projects/pf/head/sys/contrib/pf/net/pf_norm.c Sat Feb 25 09:14:17 2012 (r232148) @@ -1670,6 +1670,7 @@ pf_normalize_tcp_stateful(struct mbuf *m * connection limit until we can come up with a better * lowerbound to the TS echo check. */ + struct timeval delta_ts; int ts_fudge; @@ -1685,9 +1686,10 @@ pf_normalize_tcp_stateful(struct mbuf *m /* Calculate max ticks since the last timestamp */ #define TS_MAXFREQ 1100 /* RFC max TS freq of 1Khz + 10% skew */ #define TS_MICROSECS 1000000 /* microseconds per second */ - timevalsub(&uptime, &src->scrub->pfss_last); - tsval_from_last = (uptime.tv_sec + ts_fudge) * TS_MAXFREQ; - tsval_from_last += uptime.tv_usec / (TS_MICROSECS/TS_MAXFREQ); + delta_ts = uptime; + timevalsub(&delta_ts, &src->scrub->pfss_last); + tsval_from_last = (delta_ts.tv_sec + ts_fudge) * TS_MAXFREQ; + tsval_from_last += delta_ts.tv_usec / (TS_MICROSECS/TS_MAXFREQ); if ((src->state >= TCPS_ESTABLISHED && dst->state >= TCPS_ESTABLISHED) && @@ -1711,8 +1713,8 @@ pf_normalize_tcp_stateful(struct mbuf *m DPFPRINTF((" tsval: %u tsecr: %u +ticks: %u " "idle: %jus %lums\n", tsval, tsecr, tsval_from_last, - (uintmax_t)uptime.tv_sec, - uptime.tv_usec / 1000)); + (uintmax_t)delta_ts.tv_sec, + delta_ts.tv_usec / 1000)); DPFPRINTF((" src->tsval: %u tsecr: %u\n", src->scrub->pfss_tsval, src->scrub->pfss_tsecr)); DPFPRINTF((" dst->tsval: %u tsecr: %u tsval0: %u"