提交 6705e867 编写于 作者: M Michael Wang 提交者: Pablo Neira Ayuso

netfilter: replace list_for_each_continue_rcu with new interface

This patch replaces list_for_each_continue_rcu() with
list_for_each_entry_continue_rcu() to allow removing
list_for_each_continue_rcu().
Signed-off-by: NMichael Wang <wangyun@linux.vnet.ibm.com>
Reviewed-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 2834a638
......@@ -131,14 +131,13 @@ unsigned int nf_iterate(struct list_head *head,
int hook_thresh)
{
unsigned int verdict;
struct nf_hook_ops *elem = list_entry_rcu(*i, struct nf_hook_ops, list);
/*
* The caller must not block between calls to this
* function because of risk of continuing from deleted element.
*/
list_for_each_continue_rcu(*i, head) {
struct nf_hook_ops *elem = (struct nf_hook_ops *)*i;
list_for_each_entry_continue_rcu(elem, head, list) {
if (hook_thresh > elem->priority)
continue;
......@@ -155,11 +154,14 @@ unsigned int nf_iterate(struct list_head *head,
continue;
}
#endif
if (verdict != NF_REPEAT)
if (verdict != NF_REPEAT) {
*i = &elem->list;
return verdict;
}
goto repeat;
}
}
*i = &elem->list;
return NF_ACCEPT;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册