summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-08-30 07:44:29 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-08-30 07:44:29 +0000
commit013096aa5fcffb3a5faf16af3aed4eb816153cfa (patch)
tree5d626f85e0fc85c26991ac43eac7c520050eb06e /sys
parent79aeedcbe4b6107a92be9f0af6588bea3c8d20fd (diff)
Increment the states reference counter in the rule attached to the state
being inserted, so that the counter does not wrap back when the state is removed. This fixes pfsync setups with adaptive timeouts. From Chris Pascoe ok canacar@ dhartmei@ henning@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_pfsync.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 01d4ef824c2..66b5c5c2ee1 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.36 2004/08/03 05:32:28 mcbride Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.37 2004/08/30 07:44:28 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -199,6 +199,8 @@ pfsync_insert_net_state(struct pfsync_state *sp)
st->rule.ptr = r;
/* XXX get pointers to nat_rule and anchor */
+ r->states++;
+
/* fill in the rest of the state entry */
pf_state_host_ntoh(&sp->lan, &st->lan);
pf_state_host_ntoh(&sp->gwy, &st->gwy);