Skip to content

Commit 81ea010

Browse files
author
Florian Westphal
committed
netfilter: nf_tables: add rescheduling points during loop detection walks
Add explicit rescheduling points during ruleset walk. Switching to a faster algorithm is possible but this is a much smaller change, suitable for nf tree. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1460 Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 99a63d3 commit 81ea010

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,6 +3340,8 @@ int nft_chain_validate(const struct nft_ctx *ctx, const struct nft_chain *chain)
33403340
if (err < 0)
33413341
return err;
33423342
}
3343+
3344+
cond_resched();
33433345
}
33443346

33453347
return 0;
@@ -9367,9 +9369,13 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
93679369
break;
93689370
}
93699371
}
9372+
9373+
cond_resched();
93709374
}
93719375

93729376
list_for_each_entry(set, &ctx->table->sets, list) {
9377+
cond_resched();
9378+
93739379
if (!nft_is_active_next(ctx->net, set))
93749380
continue;
93759381
if (!(set->flags & NFT_SET_MAP) ||

0 commit comments

Comments
 (0)