diff options
author | Philipp Buehler <pb@cvs.openbsd.org> | 2004-04-25 18:09:31 +0000 |
---|---|---|
committer | Philipp Buehler <pb@cvs.openbsd.org> | 2004-04-25 18:09:31 +0000 |
commit | ce184315569fb7e18963a56a2700337ab00a31da (patch) | |
tree | 1bcbf5c06b6b252f5c92c13ce0a5c7c35e0a826e /sys/net/if_pfsync.c | |
parent | cc48719d920fdf751342177cd355507522483134 (diff) |
get rid of a complete state tree walk at state expire while in splnet()
ok mcbride@ henning@
Diffstat (limited to 'sys/net/if_pfsync.c')
-rw-r--r-- | sys/net/if_pfsync.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 11aae4fb565..2ac08a3dbd5 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.28 2004/04/25 17:52:37 pb Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.29 2004/04/25 18:09:30 pb Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -326,11 +326,12 @@ pfsync_input(struct mbuf *m, ...) } RB_FOREACH(st, pf_state_tree_lan_ext, &kif->pfik_lan_ext) { - if (st->creatorid == creatorid) + if (st->creatorid == creatorid) { st->timeout = PFTM_PURGE; + pf_purge_expired_state(st); + } } } - pf_purge_expired_states(); splx(s); break; @@ -475,15 +476,10 @@ pfsync_input(struct mbuf *m, ...) pfsyncstats.pfsyncs_badstate++; continue; } - /* - * XXX - * pf_purge_expired_states() is expensive, - * we really want to purge the state directly. - */ st->timeout = PFTM_PURGE; st->sync_flags |= PFSTATE_FROMSYNC; + pf_purge_expired_state(st); } - pf_purge_expired_states(); splx(s); break; case PFSYNC_ACT_UPD_C: { @@ -601,15 +597,10 @@ pfsync_input(struct mbuf *m, ...) pfsyncstats.pfsyncs_badstate++; continue; } - /* - * XXX - * pf_purge_expired_states() is expensive, - * we really want to purge the state directly. - */ st->timeout = PFTM_PURGE; st->sync_flags |= PFSTATE_FROMSYNC; + pf_purge_expired_state(st); } - pf_purge_expired_states(); splx(s); break; case PFSYNC_ACT_INS_F: |