selftests: nft_nat: Simplify port shadow notrack test
authorPhil Sutter <phil@nwl.cc>
Wed, 3 Nov 2021 18:53:43 +0000 (19:53 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 8 Nov 2021 10:26:57 +0000 (11:26 +0100)
The second rule in prerouting chain was probably a leftover: The router
listens on veth0, so not tracking connections via that interface is
sufficient. Likewise, the rule in output chain can be limited to that
interface as well.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tools/testing/selftests/netfilter/nft_nat.sh

index 905c033db74dc9ec3bae100e9198ea20e304c591..c62e4e26252c152b3b5c77c0b2ac01a384b2a855 100755 (executable)
@@ -818,11 +818,10 @@ table $family raw {
        chain prerouting {
                type filter hook prerouting priority -300; policy accept;
                meta iif veth0 udp dport 1405 notrack
-               udp dport 1405 notrack
        }
        chain output {
                type filter hook output priority -300; policy accept;
-               udp sport 1405 notrack
+               meta oif veth0 udp sport 1405 notrack
        }
 }
 EOF