[LTP] icmp_rate_limit01: Fix rate limit change on older kernels
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Wed Apr 29 14:26:10 CEST 2026
Hi Martin,
On Wed, 29 Apr 2026 14:11:27 +0200, Martin Doucha wrote:
> icmp_rate_limit01: Fix rate limit change on older kernels
> + if (!access("/proc/sys/net/ipv4/icmp_msgs_burst", F_OK))
> + SAFE_FILE_PRINTF("/proc/sys/net/ipv4/icmp_msgs_burst", "50");
SAFE_ACCESS() exists in tst_safe_macros.h, but since it calls tst_brk()
on failure it cannot be used here — file absence is the expected case on
pre-v6.12 kernels and handling it gracefully is the whole point. Is raw
access() acceptable for this feature-probe pattern, or should a different
idiom be used?
Pre-existing issues noticed in the surrounding code (not introduced
by this patch):
- testcases/cve/icmp_rate_limit01.c:203 — sleep(2) in packet_batch()
used to wait for ICMP responses; consider a poll-based approach.
---
Note:
Our agent completed the review of the patch.
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list