]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: auto-removal of chain hook on netns removal
authorFlorian Westphal <fw@strlen.de>
Tue, 19 Oct 2021 12:07:25 +0000 (14:07 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 19 Oct 2021 12:08:41 +0000 (14:08 +0200)
This is the nft equivalent of the syzbot report that lead to
kernel commit 68a3765c659f8
("netfilter: nf_tables: skip netdev events generated on netns removal").

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/chains/0043chain_ingress_0

index 86dc075d7923b93130111d1d5bdbbc6027a4d380..bff464687a6f8c46bad406598748edc54e82470f 100755 (executable)
@@ -14,5 +14,11 @@ RULESET="table inet filter {
        }
 }"
 
+# Test auto-removal of chain hook on netns removal
+unshare -n bash -c "ip link add br0 type bridge; \
+ $NFT add table netdev test; \
+ $NFT add chain netdev test ingress { type filter hook ingress device \"br0\" priority 0\; policy drop\; } ; \
+" || exit 1
+
 $NFT -f - <<< "$RULESET" && exit 0
 exit 1