selftests: netfilter: fix udpclash tool hang
authorFlorian Westphal <fw@strlen.de>
Wed, 27 Aug 2025 17:17:32 +0000 (19:17 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 4 Sep 2025 07:19:24 +0000 (09:19 +0200)
commit661a4f307fe0f80c1d544e09476ccba9037e8e65
tree98ec1c30b505dda4c6c89960b64ae636ea732543
parent8156210d36a43e76372312c87eb5ea3dbb405a85
selftests: netfilter: fix udpclash tool hang

Yi Chen reports that 'udpclash' loops forever depending on compiler
(and optimization level used); while (x == 1) gets optimized into
for (;;).  Add volatile qualifier to avoid that.

While at it, also run it under timeout(1) and fix the resize script
to not ignore the timeout passed as second parameter to insert_flood.

Reported-by: Yi Chen <yiche@redhat.com>
Suggested-by: Yi Chen <yiche@redhat.com>
Fixes: 78a588363587 ("selftests: netfilter: add conntrack clash resolution test case")
Signed-off-by: Florian Westphal <fw@strlen.de>
tools/testing/selftests/net/netfilter/conntrack_clash.sh
tools/testing/selftests/net/netfilter/conntrack_resize.sh
tools/testing/selftests/net/netfilter/udpclash.c