Skip to contentSkip to conversation

tests: shell: check for removing table via handle with incorrect family

PATCH New Pablo Neira Ayuso 1 participant 1 message Jun 27, 2024 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 tests: shell: check for removing table via handle with incorrect family

This test checks for upstream commit:

f6e1532a2697 ("netfilter: nf_tables: validate family when identifying table via handle")

---
 tests/shell/testcases/transactions/handle_bad_family | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100755 tests/shell/testcases/transactions/handle_bad_family
tests/shell/testcases/transactions/handle_bad_family new file +9 -0
new file mode 100755
index 000000000000..592241890a69
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+NFT=nft
+
+HANDLE=$($NFT -a -e add table ip x | cut -d '#' -f 2 | awk '{ print $2 }' | head -1)
+
+# should fail
+$NFT delete table inet handle $HANDLE
+[ $? -ne 0 ] && exit 0
Signature · 1 line
2.30.2