diff options
author | ru <ru@FreeBSD.org> | 2003-12-19 15:09:12 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2003-12-19 15:09:12 +0000 |
commit | 3c75dd4b075493a8936b3afcdf9af74f9467c675 (patch) | |
tree | 5bd6e497113b15f628c1b487657f56a39483f80d /sys/netgraph | |
parent | 7b3cca8521f8011e53960ec7537f0267841caa9e (diff) | |
download | FreeBSD-src-3c75dd4b075493a8936b3afcdf9af74f9467c675.zip FreeBSD-src-3c75dd4b075493a8936b3afcdf9af74f9467c675.tar.gz |
Fixed panic on hook disconnection that previous revision has introduced.
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_etf.c | 13 |
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; } } |