]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: exercise validation with nft -c
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 30 Oct 2020 19:36:22 +0000 (20:36 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 31 Oct 2020 11:51:58 +0000 (12:51 +0100)
Using oif in fib from prerouting is not support, make sure -c reports an
error.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/nft-f/0023check_1 [new file with mode: 0755]

diff --git a/tests/shell/testcases/nft-f/0023check_1 b/tests/shell/testcases/nft-f/0023check_1
new file mode 100755 (executable)
index 0000000..42793b6
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+RULESET="table ip foo {
+       chain bar {
+               type filter hook prerouting priority 0;
+       }
+}"
+
+$NFT -f - <<< "$RULESET"
+
+$NFT -c add rule foo bar fib saddr . oif type local && exit 1
+exit 0