]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
Amend "tests: shell: Fix ifname_based_hooks feature check"
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 28 Jul 2025 22:52:55 +0000 (00:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 31 Jul 2025 22:52:27 +0000 (00:52 +0200)
commit 646acfaceb1f550c982c31ba6e60996b0bb012d7 upstream.

The following syntax:

  type filter hook ingress priority 0; devices = { d0 };

is not parsed in 1.0.6.y.

And remove device deletion, this is only available since 1.0.8 in:

commit a66b5ad9540dd64c7c67006201b8b3ccf8e4316b
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Wed Apr 19 11:50:01 2023 +0200

    src: allow for updating devices on existing netdev chain

skip netdev_chain_dormant_autoremove for new kernels.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/features/ifname_based_hooks.sh
tests/shell/testcases/chains/netdev_chain_dormant_autoremove

index cada6956f165badd750a07e4b6a7b840c9b5b426..e1fd6f03522008b5db761945f4c122ce47fa837e 100755 (executable)
@@ -5,7 +5,7 @@
 unshare -n bash -c "ip link add d0 type dummy; \
        $NFT \"table netdev t { \
                chain c { \
-                       type filter hook ingress priority 0; devices = { d0 }; \
+                       type filter hook ingress devices = { d0 } priority 0;\
                }; \
        }\"; \
        ip link del d0; \
index 8455f310445e92a56e51f72fed41985ab89280dc..72a90cf84c7f58b1b7e803b733509f96920c494e 100755 (executable)
@@ -2,6 +2,11 @@
 
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_netdev_chain_multidevice)
 
+if [ "$NFT_TEST_HAVE_ifname_based_hooks" = y ]; then
+       echo "Test skipped due to NFT_TEST_HAVE_ifname_based_hooks=y"
+       exit 77
+fi
+
 set -e
 
 ip link add dummy0 type dummy
@@ -9,6 +14,3 @@ ip link add dummy1 type dummy
 $NFT add table netdev test { flags dormant\; }
 $NFT add chain netdev test ingress { type filter hook ingress devices = { "dummy0", "dummy1" } priority 0\; policy drop\; }
 ip link del dummy0
-if [ "$NFT_TEST_HAVE_ifname_based_hooks" = y ]; then
-       $NFT 'delete chain netdev test ingress { devices = { "dummy0" }; }'
-fi