From owner-svn-src-projects@FreeBSD.ORG Tue May 29 19:46:43 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 9E7B8106564A; Tue, 29 May 2012 19:46:43 +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 8A3438FC08; Tue, 29 May 2012 19:46:43 +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 q4TJkhZh099006; Tue, 29 May 2012 19:46:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4TJkhph099004; Tue, 29 May 2012 19:46:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201205291946.q4TJkhph099004@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 29 May 2012 19:46:43 +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: r236252 - 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: Tue, 29 May 2012 19:46:43 -0000 Author: glebius Date: Tue May 29 19:46:42 2012 New Revision: 236252 URL: http://svn.freebsd.org/changeset/base/236252 Log: Restore crutch removed in r235991. When pf(4) is initialized at boot time, the time_second isn't initialized yet, and we need to workaround that. :( Modified: projects/pf/head/sys/contrib/pf/net/pf_if.c Modified: projects/pf/head/sys/contrib/pf/net/pf_if.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_if.c Tue May 29 18:44:53 2012 (r236251) +++ projects/pf/head/sys/contrib/pf/net/pf_if.c Tue May 29 19:46:42 2012 (r236252) @@ -213,7 +213,14 @@ pfi_kif_attach(struct pfi_kif *kif, cons bzero(kif, sizeof(*kif)); strlcpy(kif->pfik_name, kif_name, sizeof(kif->pfik_name)); - kif->pfik_tzero = time_second; + /* + * It seems that the value of time_second is in unintialzied state + * when pf sets interface statistics clear time in boot phase if pf + * was statically linked to kernel. Instead of setting the bogus + * time value have pfi_get_ifaces handle this case. In + * pfi_get_ifaces it uses time_second if it sees the time is 0. + */ + kif->pfik_tzero = time_second > 1 ? time_second : 0; TAILQ_INIT(&kif->pfik_dynaddrs); RB_INSERT(pfi_ifhead, &V_pfi_ifs, kif);