summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_etf.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2003-12-19 15:09:12 +0000
committerru <ru@FreeBSD.org>2003-12-19 15:09:12 +0000
commit3c75dd4b075493a8936b3afcdf9af74f9467c675 (patch)
tree5bd6e497113b15f628c1b487657f56a39483f80d /sys/netgraph/ng_etf.c
parent7b3cca8521f8011e53960ec7537f0267841caa9e (diff)
downloadFreeBSD-src-3c75dd4b075493a8936b3afcdf9af74f9467c675.zip
FreeBSD-src-3c75dd4b075493a8936b3afcdf9af74f9467c675.tar.gz
Fixed panic on hook disconnection that previous revision has introduced.
Diffstat (limited to 'sys/netgraph/ng_etf.c')
-rw-r--r--sys/netgraph/ng_etf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/netgraph/ng_etf.c b/sys/netgraph/ng_etf.c
index 1db84a0..2fa3073 100644
--- a/sys/netgraph/ng_etf.c
+++ b/sys/netgraph/ng_etf.c
@@ -466,15 +466,18 @@ ng_etf_disconnect(hook_p hook)
{
const etf_p etfp = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
int i;
- struct filter *fil;
+ struct filter *fil1, *fil2;
/* purge any rules that refer to this filter */
for (i = 0; i < HASHSIZE; i++) {
- LIST_FOREACH(fil, (etfp->hashtable + i), next) {
- if (fil->match_hook == hook) {
- LIST_REMOVE(fil, next);
- FREE(fil, M_NETGRAPH_ETF);
+ fil1 = LIST_FIRST(&etfp->hashtable[i]);
+ while (fil1 != NULL) {
+ fil2 = LIST_NEXT(fil1, next);
+ if (fil1->match_hook == hook) {
+ LIST_REMOVE(fil1, next);
+ FREE(fil1, M_NETGRAPH_ETF);
}
+ fil1 = fil2;
}
}
OpenPOWER on IntegriCloud