From 013096aa5fcffb3a5faf16af3aed4eb816153cfa Mon Sep 17 00:00:00 2001 From: Ryan Thomas McBride Date: Mon, 30 Aug 2004 07:44:29 +0000 Subject: 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@ --- sys/net/if_pfsync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys') 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); -- cgit v1.2.3