mirror of
https://git.netfilter.org/nftables
synced 2026-01-31 04:44:07 +00:00
This update is needed for kernel patch:
("netfilter: nf_tables: Tolerate chains with no remaining hooks")
otherwise this hits DUMP FAILED in newer kernels.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
31 lines
725 B
Bash
Executable File
31 lines
725 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
iface_cleanup() {
|
|
ip link del d0 &>/dev/null || :
|
|
}
|
|
trap 'iface_cleanup' EXIT
|
|
iface_cleanup
|
|
|
|
ip link add d0 type dummy
|
|
|
|
$NFT flush ruleset
|
|
$NFT add table inet test
|
|
$NFT add chain inet test c
|
|
|
|
$NFT flush ruleset
|
|
|
|
RULESET='{"nftables":[{"flush":{"ruleset":null}},{"add":{"table":{"family":"netdev","name":"test_table"}}},{"add":{"chain":{"family":"netdev","table":"test_table","name":"test_chain","type":"filter","hook":"ingress","prio":0,"dev":"d0","policy":"accept"}}}]}'
|
|
|
|
if [ "$NFT_TEST_HAVE_json" != n ]; then
|
|
$NFT -j -f - <<< $RULESET
|
|
fi
|
|
|
|
if [ "$NFT_TEST_HAVE_json" = n ]; then
|
|
echo "Test partially skipped due to missing JSON support."
|
|
exit 77
|
|
fi
|
|
|
|
$NFT delete chain netdev test_table test_chain
|