Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 May 2012 19:46:43 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r236252 - projects/pf/head/sys/contrib/pf/net
Message-ID:  <201205291946.q4TJkhph099004@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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