summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2007-12-02 11:39:46 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2007-12-02 11:39:46 +0000
commit56e8b22af2d7d8acd5cf38f4067bfd2fcd87acf1 (patch)
treead35faa20003367c4c904ee5c68a74ca5e2b3953 /sys
parentb4d87547262978a6ddb103561601e67c42aabb17 (diff)
Set expiry timestamp when importing a state, otherwise it expires on the
next expiry run. ok dlg@ henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf_ioctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 1a4890513e2..8ee80e7ba82 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.187 2007/12/02 11:36:39 pascoe Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.188 2007/12/02 11:39:45 pascoe Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -918,6 +918,9 @@ pf_state_import(struct pfsync_state *sp, struct pf_state_key *sk,
s->anchor.ptr = NULL;
s->rt_kif = NULL;
s->creation = time_second;
+ s->expire = time_second;
+ if (sp->expire > 0)
+ s->expire -= pf_default_rule.timeout[sp->timeout] - sp->expire;
s->pfsync_time = 0;
s->packets[0] = s->packets[1] = 0;
s->bytes[0] = s->bytes[1] = 0;