diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-09-17 21:49:16 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-09-17 21:49:16 +0000 |
commit | cef868df3eafab7ee6f838efd13c5245a815cdc0 (patch) | |
tree | 3d7edf2472b223150136dc27ccd8fda60804e341 /sys/net/if_pfsync.c | |
parent | f5f492c7f1b2571ffcaee3992c1baecc220bb68a (diff) |
Clean up reference counting wrt state creation and destruction. Fixes
problems with adaptive timeouts, max-states limits, and rules not being
freed from memory.
Diff from Chris Pascoe.
ok henning@ dhartmei@
Diffstat (limited to 'sys/net/if_pfsync.c')
-rw-r--r-- | sys/net/if_pfsync.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 66b5c5c2ee1..0bf5f902769 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.37 2004/08/30 07:44:28 mcbride Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.38 2004/09/17 21:49:15 mcbride Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -199,6 +199,7 @@ pfsync_insert_net_state(struct pfsync_state *sp) st->rule.ptr = r; /* XXX get pointers to nat_rule and anchor */ + /* XXX when we have nat_rule/anchors, use STATE_INC_COUNTERS */ r->states++; /* fill in the rest of the state entry */ @@ -227,6 +228,8 @@ pfsync_insert_net_state(struct pfsync_state *sp) if (pf_insert_state(kif, st)) { pfi_maybe_destroy(kif); + /* XXX when we have nat_rule/anchors, use STATE_DEC_COUNTERS */ + r->states--; pool_put(&pf_state_pl, st); return (EINVAL); } |