]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: don't allow nat map with specified protocol
authorFlorian Westphal <fw@strlen.de>
Thu, 20 Mar 2025 08:39:20 +0000 (09:39 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 20 Mar 2025 10:43:16 +0000 (11:43 +0100)
commit43cf4a2973ee9e3ab20edce47c6a054485707592
tree332da3f9b0cab0707e2ef846b4f98db0018ac64b
parentb00fc8cd1379f6e403538943d55d297b624f185b
evaluate: don't allow nat map with specified protocol

Included bogon asserts:
src/netlink_linearize.c:1305: netlink_gen_nat_stmt: Assertion `stmt->nat.proto == NULL' failed.

The comment right above the assertion says:
  nat_stmt evaluation step doesn't allow
  STMT_NAT_F_CONCAT && stmt->nat.proto.

... except it does allow it.  Disable this.

Fixes: c68314dd4263 ("src: infer NAT mapping with concatenation from set")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
tests/shell/testcases/bogons/nat_map_and_protocol_assert [new file with mode: 0644]