aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wang <wangyun@linux.vnet.ibm.com>2012-08-16 14:33:39 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2012-08-22 13:17:20 -0400
commit6705e86724f1ac83394592be7dbfc0c07ac25aa2 (patch)
tree266845a27df757cd561b65a855d4a3994139e318
parent2834a6386b86a5dd20380aadb01897c525448aa7 (diff)
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: Michael Wang <wangyun@linux.vnet.ibm.com> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/netfilter/core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 0bc6b60db4df..8f4b0b2b6f80 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -131,14 +131,13 @@ unsigned int nf_iterate(struct list_head *head,
131 int hook_thresh) 131 int hook_thresh)
132{ 132{
133 unsigned int verdict; 133 unsigned int verdict;
134 struct nf_hook_ops *elem = list_entry_rcu(*i, struct nf_hook_ops, list);
134 135
135 /* 136 /*
136 * The caller must not block between calls to this 137 * The caller must not block between calls to this
137 * function because of risk of continuing from deleted element. 138 * function because of risk of continuing from deleted element.
138 */ 139 */
139 list_for_each_continue_rcu(*i, head) { 140 list_for_each_entry_continue_rcu(elem, head, list) {
140 struct nf_hook_ops *elem = (struct nf_hook_ops *)*i;
141
142 if (hook_thresh > elem->priority) 141 if (hook_thresh > elem->priority)
143 continue; 142 continue;
144 143
@@ -155,11 +154,14 @@ repeat:
155 continue; 154 continue;
156 } 155 }
157#endif 156#endif
158 if (verdict != NF_REPEAT) 157 if (verdict != NF_REPEAT) {
158 *i = &elem->list;
159 return verdict; 159 return verdict;
160 }
160 goto repeat; 161 goto repeat;
161 } 162 }
162 } 163 }
164 *i = &elem->list;
163 return NF_ACCEPT; 165 return NF_ACCEPT;
164} 166}
165 167