summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAntonio Ojea <aojea@google.com>2026-09-28 18:58:03 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2026-10-18 02:34:20 +0200
commit853d419bfb342318a38915087726a5ac3b992d4c (patch)
tree3a4aeafc8811a5e41b9114d11afee79b4496d53b /include/linux
parent72ac1c0937dff7e32ad87829cd23fbc82347fe48 (diff)
selftests: netfilter: nft_queue: check the scope of the hook drop flush
Add test_hook_drop_scope. It queues 20 UDP packets from an inet output chain to a queue program that holds all verdicts, deletes a base chain while they wait, and reads the queue length from /proc/net/netfilter/nfnetlink_queue right after the deletion. It then releases the queue program and checks with a counter in the input chain and the packet total of the queue program that the surviving packets are delivered. Deleting a base chain at another hook point (ip6 prerouting) must keep the 20 queued packets. Deleting a base chain at the queueing hook point (inet output, another priority) drops them, because the index of a queued packet into the hook array of its hook point is stale once that array changed. The second case documents the remaining behaviour so that a change to it is visible. To hold the packets without depending on timing, add the -H option to the nf_queue helper: it blocks SIGUSR1, reads the first packet and waits in sigwait() until it receives SIGUSR1, then sends the verdicts as usual. The test sends the signal after the ruleset change, so the queue length it reads is exact on slow machines too. Without the previous patch the first case fails: 0 of 20 packets remain queued after the deletion and none is delivered. The test and the helper option were written with an LLM coding assistant from a task description; the author reviewed the result, and validated the test in virtme-ng on kernels with and without the previous patch. Assisted-by: LLM Signed-off-by: Antonio Ojea <aojea@google.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions