diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2003-12-19 15:09:12 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2003-12-19 15:09:12 +0000 |
commit | 05f768d918f3a3f2cf8db724811940cca21ed629 (patch) | |
tree | 5bd6e497113b15f628c1b487657f56a39483f80d /sys/netgraph/ng_etf.c | |
parent | c7148de1a6542ffda8d939d24cd03281af4e5262 (diff) | |
download | src-05f768d918f3a3f2cf8db724811940cca21ed629.tar.gz src-05f768d918f3a3f2cf8db724811940cca21ed629.zip |
Fixed panic on hook disconnection that previous revision has introduced.
Notes
Notes:
svn path=/head/; revision=123670
Diffstat (limited to 'sys/netgraph/ng_etf.c')
-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 1db84a00043f..2fa3073e6f40 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; } } |