openwrt/package/network/utils/iptables/patches
Rodrigo B. de Sousa Martins 44b1993f76 iptables: backport "nft: track each register individually" from 1.9
From the upstream repo:

Instead of assuming only one register is used, track all 16 regs
individually.

This avoids need for the 'PREV_PAYLOAD' hack and also avoids the need to
clear out old flags:

When we see that register 'x' will be written to, that register state is
reset automatically.

Existing dissector decodes
ip saddr 1.2.3.4 meta l4proto tcp
... as
-s 6.0.0.0 -p tcp

iptables-nft -s 1.2.3.4 -p tcp is decoded correctly because the expressions
are ordered like:

meta l4proto tcp ip saddr 1.2.3.4
                                                                                                                                                                                                                   |
... and 'meta l4proto' did clear the PAYLOAD flag.

The simpler fix is:
		ctx->flags &= ~NFT_XT_CTX_PAYLOAD;

in nft_parse_cmp(), but that breaks dissection of '1-42', because
the second compare ('cmp lte 42') will not find the
payload expression anymore.

This commit fixes #11169 and openwrt/packages#22727, and potentially anyone that uses iptables-nft legacy support.

Signed-off-by: Rodrigo B. de Sousa Martins <rodrigo.sousa.577@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16504
[Added patch header]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-19 19:42:37 +02:00
..
010-add-set-dscpmark-support.patch iptables: update to 1.8.6 2021-01-09 10:24:04 +01:00
020-treewide-use-uint-instead-of-u_int.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
030-revert-fix-build-for-missing-ETH_ALEN-definition.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
040-xshared-Fix-build-for-Werror-format-security.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
050-build-fix-error-during-out-of-tree-build.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
060-libxtables-unexport-init_extensions-declarations.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
070-extensions-string-Review-parse_string-function.patch iptables: backport patch fixing bug with string module 2023-11-12 14:13:41 +01:00
101-remove-check-already.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
102-iptables-disable-modprobe.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
103-optional-xml.patch iptables: update to 1.8.3 2019-07-02 21:50:54 +02:00
104-nft-track-each-register-individually.patch iptables: backport "nft: track each register individually" from 1.9 2024-10-19 19:42:37 +02:00
200-configurable_builtin.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
600-shared-libext.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
700-disable-legacy-revisions.patch iptables: update to 1.8.8 2022-07-10 19:07:47 +02:00
800-flowoffload_target.patch kernel: add support for enabling hardware flow offload via iptables 2018-04-05 18:12:30 +02:00