OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 226... | Line 226... | |||
226 | - nf_tables_unregister_hooks(net, table, chain, afi->nops); |
226 | - nf_tables_unregister_hooks(net, table, chain, afi->nops); |
|
227 | + nf_tables_unregister_hook(net, table, chain); |
227 | + nf_tables_unregister_hook(net, table, chain); |
|
228 | err1: |
228 | err1: |
|
229 | nf_tables_chain_destroy(chain); |
229 | nf_tables_chain_destroy(chain); |
|
Line 230... | Line 230... | |||
230 | |
230 | |
|
231 | @@ -1478,13 +1469,12 @@ static int nf_tables_updchain(struct nft |
231 | @@ -1478,14 +1469,13 @@ static int nf_tables_updchain(struct nft |
|
232 | const struct nlattr * const *nla = ctx->nla; |
232 | const struct nlattr * const *nla = ctx->nla; |
|
233 | struct nft_table *table = ctx->table; |
233 | struct nft_table *table = ctx->table; |
|
234 | struct nft_chain *chain = ctx->chain; |
234 | struct nft_chain *chain = ctx->chain; |
|
235 | - struct nft_af_info *afi = ctx->afi; |
235 | - struct nft_af_info *afi = ctx->afi; |
|
236 | struct nft_base_chain *basechain; |
236 | struct nft_base_chain *basechain; |
|
237 | struct nft_stats *stats = NULL; |
237 | struct nft_stats *stats = NULL; |
|
- | 238 | struct nft_chain_hook hook; |
||
238 | struct nft_chain_hook hook; |
239 | const struct nlattr *name; |
|
239 | struct nf_hook_ops *ops; |
240 | struct nf_hook_ops *ops; |
|
240 | struct nft_trans *trans; |
241 | struct nft_trans *trans; |
|
241 | - int err, i; |
242 | - int err, i; |
|
Line 242... | Line 243... | |||
242 | + int err; |
243 | + int err; |
|
243 | |
244 | |
|
244 | if (nla[NFTA_CHAIN_HOOK]) { |
245 | if (nla[NFTA_CHAIN_HOOK]) { |
|
245 | if (!nft_is_base_chain(chain)) |
246 | if (!nft_is_base_chain(chain)) |
|
246 | @@ -1501,14 +1491,12 @@ static int nf_tables_updchain(struct nft |
247 | @@ -1502,14 +1492,12 @@ static int nf_tables_updchain(struct nft |
|
Line 247... | Line 248... | |||
247 | return -EBUSY; |
248 | return -EBUSY; |
|
248 | } |
249 | } |
|
Line 262... | Line 263... | |||
262 | + nft_chain_release_hook(&hook); |
263 | + nft_chain_release_hook(&hook); |
|
263 | + return -EBUSY; |
264 | + return -EBUSY; |
|
264 | } |
265 | } |
|
265 | nft_chain_release_hook(&hook); |
266 | nft_chain_release_hook(&hook); |
|
266 | } |
267 | } |
|
267 | @@ -5129,10 +5117,9 @@ static int nf_tables_commit(struct net * |
268 | @@ -5113,10 +5101,9 @@ static int nf_tables_commit(struct net * |
|
268 | case NFT_MSG_DELCHAIN: |
269 | case NFT_MSG_DELCHAIN: |
|
269 | list_del_rcu(&trans->ctx.chain->list); |
270 | list_del_rcu(&trans->ctx.chain->list); |
|
270 | nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN); |
271 | nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN); |
|
271 | - nf_tables_unregister_hooks(trans->ctx.net, |
272 | - nf_tables_unregister_hooks(trans->ctx.net, |
|
272 | - trans->ctx.table, |
273 | - trans->ctx.table, |
|
Line 276... | Line 277... | |||
276 | + trans->ctx.table, |
277 | + trans->ctx.table, |
|
277 | + trans->ctx.chain); |
278 | + trans->ctx.chain); |
|
278 | break; |
279 | break; |
|
279 | case NFT_MSG_NEWRULE: |
280 | case NFT_MSG_NEWRULE: |
|
280 | nft_clear(trans->ctx.net, nft_trans_rule(trans)); |
281 | nft_clear(trans->ctx.net, nft_trans_rule(trans)); |
|
281 | @@ -5269,10 +5256,9 @@ static int nf_tables_abort(struct net *n |
282 | @@ -5253,10 +5240,9 @@ static int nf_tables_abort(struct net *n |
|
282 | } else { |
283 | } else { |
|
283 | trans->ctx.table->use--; |
284 | trans->ctx.table->use--; |
|
284 | list_del_rcu(&trans->ctx.chain->list); |
285 | list_del_rcu(&trans->ctx.chain->list); |
|
285 | - nf_tables_unregister_hooks(trans->ctx.net, |
286 | - nf_tables_unregister_hooks(trans->ctx.net, |
|
286 | - trans->ctx.table, |
287 | - trans->ctx.table, |
|
Line 290... | Line 291... | |||
290 | + trans->ctx.table, |
291 | + trans->ctx.table, |
|
291 | + trans->ctx.chain); |
292 | + trans->ctx.chain); |
|
292 | } |
293 | } |
|
293 | break; |
294 | break; |
|
294 | case NFT_MSG_DELCHAIN: |
295 | case NFT_MSG_DELCHAIN: |
|
295 | @@ -5375,7 +5361,7 @@ int nft_chain_validate_hooks(const struc |
296 | @@ -5359,7 +5345,7 @@ int nft_chain_validate_hooks(const struc |
|
296 | if (nft_is_base_chain(chain)) { |
297 | if (nft_is_base_chain(chain)) { |
|
297 | basechain = nft_base_chain(chain); |
298 | basechain = nft_base_chain(chain); |
|
Line 298... | Line 299... | |||
298 | |
299 | |
|
299 | - if ((1 << basechain->ops[0].hooknum) & hook_flags) |
300 | - if ((1 << basechain->ops[0].hooknum) & hook_flags) |
|
300 | + if ((1 << basechain->ops.hooknum) & hook_flags) |
301 | + if ((1 << basechain->ops.hooknum) & hook_flags) |
|
Line 301... | Line 302... | |||
301 | return 0; |
302 | return 0; |
|
302 | |
303 | |
|
Line 303... | Line 304... | |||
303 | return -EOPNOTSUPP; |
304 | return -EOPNOTSUPP; |
|
Line 304... | Line 305... | |||
304 | @@ -5857,8 +5843,7 @@ int __nft_release_basechain(struct nft_c |
305 | @@ -5841,8 +5827,7 @@ int __nft_release_basechain(struct nft_c |
|
305 | |
306 | |
|
306 | BUG_ON(!nft_is_base_chain(ctx->chain)); |
307 | BUG_ON(!nft_is_base_chain(ctx->chain)); |
|
307 | |
308 | |
|
308 | - nf_tables_unregister_hooks(ctx->net, ctx->chain->table, ctx->chain, |
309 | - nf_tables_unregister_hooks(ctx->net, ctx->chain->table, ctx->chain, |
|
309 | - ctx->afi->nops); |
310 | - ctx->afi->nops); |
|
310 | + nf_tables_unregister_hook(ctx->net, ctx->chain->table, ctx->chain); |
311 | + nf_tables_unregister_hook(ctx->net, ctx->chain->table, ctx->chain); |
|
Line 311... | Line 312... | |||
311 | list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) { |
312 | list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) { |
|
312 | list_del(&rule->list); |
313 | list_del(&rule->list); |
|
313 | ctx->chain->use--; |
314 | ctx->chain->use--; |
|
314 | @@ -5887,8 +5872,7 @@ static void __nft_release_afinfo(struct |
315 | @@ -5871,8 +5856,7 @@ static void __nft_release_afinfo(struct |
|
Line 377... | Line 378... | |||
377 | - const struct nf_hook_ops *ops = &basechain->ops[0]; |
378 | - const struct nf_hook_ops *ops = &basechain->ops[0]; |
|
378 | + const struct nf_hook_ops *ops = &basechain->ops; |
379 | + const struct nf_hook_ops *ops = &basechain->ops; |
|
Line 379... | Line 380... | |||
379 | |
380 | |
|
380 | par->hook_mask = 1 << ops->hooknum; |
381 | par->hook_mask = 1 << ops->hooknum; |
|
381 | } else { |
382 | } else { |
|
382 | @@ -565,7 +565,7 @@ static int nft_match_validate(const stru |
383 | @@ -564,7 +564,7 @@ static int nft_match_validate(const stru |
|
383 | if (nft_is_base_chain(ctx->chain)) { |
384 | if (nft_is_base_chain(ctx->chain)) { |
|
384 | const struct nft_base_chain *basechain = |
385 | const struct nft_base_chain *basechain = |
|
385 | nft_base_chain(ctx->chain); |
386 | nft_base_chain(ctx->chain); |
|
386 | - const struct nf_hook_ops *ops = &basechain->ops[0]; |
387 | - const struct nf_hook_ops *ops = &basechain->ops[0]; |