diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-07-26 12:00:07 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-07-26 16:56:24 +0200 |
commit | b41418e247998e134ec872d1557daa38bcdbc6c7 (patch) | |
tree | 75a6a940a79c34f135e92cc5e4aafb38cf4642b6 /tests/shell | |
parent | c9c5b5f621c37d17140dac682d211825ef321093 (diff) |
parser_bison: stateful statement support in map
Missing parser extension to support for stateful statements in map.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell')
-rwxr-xr-x | tests/shell/testcases/maps/0011vmap_0 | 25 | ||||
-rw-r--r-- | tests/shell/testcases/maps/dumps/0011vmap_0.nft | 19 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/shell/testcases/maps/0011vmap_0 b/tests/shell/testcases/maps/0011vmap_0 new file mode 100755 index 00000000..83704d48 --- /dev/null +++ b/tests/shell/testcases/maps/0011vmap_0 @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +EXPECTED="table inet filter { + map portmap { + type inet_service : verdict + counter + } + + chain ssh_input { + } + + chain wan_input { + tcp dport vmap @portmap + } + + chain prerouting { + type filter hook prerouting priority -300; policy accept; + iif vmap { "lo" : jump wan_input } + } +}" + +$NFT -f - <<< "$EXPECTED" +$NFT 'add element inet filter portmap { 22 : jump ssh_input, * : drop }' diff --git a/tests/shell/testcases/maps/dumps/0011vmap_0.nft b/tests/shell/testcases/maps/dumps/0011vmap_0.nft new file mode 100644 index 00000000..4a72b5e7 --- /dev/null +++ b/tests/shell/testcases/maps/dumps/0011vmap_0.nft @@ -0,0 +1,19 @@ +table inet filter { + map portmap { + type inet_service : verdict + counter + elements = { 22 counter packets 0 bytes 0 : jump ssh_input, * counter packets 0 bytes 0 : drop } + } + + chain ssh_input { + } + + chain wan_input { + tcp dport vmap @portmap + } + + chain prerouting { + type filter hook prerouting priority raw; policy accept; + iif vmap { "lo" : jump wan_input } + } +} |