diff options
author | 2007-07-10 15:58:37 +0000 | |
---|---|---|
committer | 2007-07-10 15:58:37 +0000 | |
commit | f469bfae629b83629e4398b69462811ddfbdaaae (patch) | |
tree | 3b86d764557c47338d0180a754f6dc6c72543154 | |
parent | implement -q to query a scsi disk for its inquiry data (vendor, model, (diff) | |
download | wireguard-openbsd-f469bfae629b83629e4398b69462811ddfbdaaae.tar.xz wireguard-openbsd-f469bfae629b83629e4398b69462811ddfbdaaae.zip |
adjust pf_find_state_all() so that it works correctly for the new global
table/state tail queue design. corrects ftp-proxy errors "server lookup
failed (no rdr?)" okay henning@
-rw-r--r-- | sys/net/pf.c | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 8265164fda7..98dca461f27 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.549 2007/07/04 08:14:14 mpf Exp $ */ +/* $OpenBSD: pf.c,v 1.550 2007/07/10 15:58:37 kurt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -560,43 +560,31 @@ pf_find_state_all(struct pf_state_key_cmp *key, u_int8_t tree, int *more) { struct pf_state_key *sk; struct pf_state *s, *ret = NULL; - struct pfi_kif *kif; pf_status.fcounters[FCNT_STATE_SEARCH]++; switch (tree) { case PF_LAN_EXT: - TAILQ_FOREACH(kif, &pfi_statehead, pfik_w_states) { - sk = RB_FIND(pf_state_tree_lan_ext, - &pf_statetbl_lan_ext, (struct pf_state_key *)key); - if (sk == NULL) - continue; - ret = TAILQ_FIRST(&sk->states); - if (more == NULL) - return (ret); - else - TAILQ_FOREACH(s, &sk->states, next) - (*more)++; - } + sk = RB_FIND(pf_state_tree_lan_ext, + &pf_statetbl_lan_ext, (struct pf_state_key *)key); break; case PF_EXT_GWY: - TAILQ_FOREACH(kif, &pfi_statehead, pfik_w_states) { - sk = RB_FIND(pf_state_tree_ext_gwy, - &pf_statetbl_ext_gwy, (struct pf_state_key *)key); - if (sk == NULL) - continue; - ret = TAILQ_FIRST(&sk->states); - if (more == NULL) - return (ret); - else - TAILQ_FOREACH(s, &sk->states, next) - (*more)++; - } + sk = RB_FIND(pf_state_tree_ext_gwy, + &pf_statetbl_ext_gwy, (struct pf_state_key *)key); break; default: panic("pf_find_state_all"); } + if (sk != NULL) { + ret = TAILQ_FIRST(&sk->states); + if (more == NULL) + return (ret); + + TAILQ_FOREACH(s, &sk->states, next) + (*more)++; + } + return (ret); } |