summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2005-02-17 03:36:31 +0000
committeryongari <yongari@FreeBSD.org>2005-02-17 03:36:31 +0000
commit13ffa2fe13caebc8b84b3960f5c00f6f26341b76 (patch)
treedbd02f276650dbfacd44ec888b633d9325cae6b2 /sys/contrib
parentc6c439fc3c87955b8088cdc29bb87d127a9c43a8 (diff)
downloadFreeBSD-src-13ffa2fe13caebc8b84b3960f5c00f6f26341b76.zip
FreeBSD-src-13ffa2fe13caebc8b84b3960f5c00f6f26341b76.tar.gz
Fix inteface clear time. pf printed "Thu Jan 1 09:00:01 1970"
in "pfctl -vvsI" output when pf was statically linked to kernel. Discussed with: mlaier
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/pf/net/pf_if.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/contrib/pf/net/pf_if.c b/sys/contrib/pf/net/pf_if.c
index 78e99e9..21d8c00 100644
--- a/sys/contrib/pf/net/pf_if.c
+++ b/sys/contrib/pf/net/pf_if.c
@@ -822,7 +822,14 @@ pfi_if_create(const char *name, struct pfi_kif *q, int flags)
p->pfik_flags = flags;
p->pfik_parent = q;
#ifdef __FreeBSD__
- p->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
+ * boottime.tv_sec if it sees the time is 0.
+ */
+ p->pfik_tzero = time_second > 1 ? time_second : 0;
#else
p->pfik_tzero = time.tv_sec;
#endif
OpenPOWER on IntegriCloud