]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: netfilter: nft_flowtable.sh: fix offload counter verification for tunnel...
authorLorenzo Bianconi <lorenzo@kernel.org>
Mon, 13 Jul 2026 12:53:22 +0000 (14:53 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 22 Jul 2026 18:34:15 +0000 (20:34 +0200)
commit1d6123f87eebb5148844cd43045c6e598799720b
treee43ecaf70f76eb1d57dbe17fa80b2e5d10fa6315
parentdb3d0e0e5d4bc5ab4fe445b9f413d1b486508ca5
selftests: netfilter: nft_flowtable.sh: fix offload counter verification for tunnel tests

The IPIP and IP6IP6 tunnel tests call check_counters() to verify
flowtable offloading occurred, but the flow-add rule only matches
meta oif "veth1". When traffic is routed through a tunnel device,
oif is the tunnel interface (tun0, tun6, etc.), not veth1, so
the flow-add rule never fires, no flowtable entry is created,
and counters stay at zero — producing a silent false pass.
Fix by adding tunnel-specific flow-add rules for each tunnel
interface. These match TCP dport 12345 traffic before the bare
accept rule, set ct mark, add the flow to the flowtable, and
increment routed_orig. The existing routed_repl rule on veth0
already handles the reply direction since decapsulated reply
packets exit through the physical interface.
Also add check_counters() for the IP6IP6 non-VLAN and
IP6IP6-over-VLAN tests which previously used a bare PASS message.

Fixes: fe8313316eaf ("selftests: netfilter: nft_flowtable.sh: Add IPIP flowtable selftest")
Fixes: 5e5180352193 ("selftests: netfilter: nft_flowtable.sh: Add IP6IP6 flowtable selftest")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tools/testing/selftests/net/netfilter/nft_flowtable.sh