]> git.ipfire.org Git - thirdparty/iptables.git/commit
nft-shared: Lookup matches in iptables_command_state
authorPhil Sutter <phil@nwl.cc>
Thu, 16 Feb 2023 20:55:54 +0000 (21:55 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 17 Feb 2023 17:18:48 +0000 (18:18 +0100)
commitf5993955ab1d1ef34a0729af2eb58e1eb4f084da
treeeda1d3e7c130bfa1703a00baaf1abd1796a3fe18
parentaa72fad69a7709f3610f1adc4794885c79788d08
nft-shared: Lookup matches in iptables_command_state

Some matches may turn into multiple nft statements (naturally or via
translation). Such statements must parse into a single extension again
in order to rebuild the rule as it was.

Introduce nft_find_match_in_cs() to iterate through the lists and drop
tcp/udp port match caching in struct nft_xt_ctx which is not needed
anymore.

Note: Match reuse is not enabled unconditionally for all matches,
because iptables supports having multiple instances of the same
extension.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft-shared.c
iptables/nft-shared.h