netfilter: nf_tables: don't store address of last rule on jump
authorFlorian Westphal <fw@strlen.de>
Tue, 11 Apr 2023 14:29:46 +0000 (16:29 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 21 Apr 2023 23:39:40 +0000 (01:39 +0200)
commitd4d89e6546e0d1ac09cb9dd353f0cb31c8a8deb1
treeef556bff3dea2eefaf71958f749c56d37f3f4e66
parente38fbfa972eb0944ce4387caf23d166c1df4b114
netfilter: nf_tables: don't store address of last rule on jump

Walk the rule headers until the trailer one (last_bit flag set) instead
of stopping at last_rule address.

This avoids the need to store the address when jumping to another chain.

This cuts size of jumpstack array by one third, on 64bit from
384 to 256 bytes.  Still, stack usage is still quite large:

scripts/stackusage:
nf_tables_core.c:258 nft_do_chain    496     static

Next patch will also remove chain pointer.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_core.c