Thread (14 messages) 14 messages, 4 authors, 2d ago

Re: [PATCH net-next v2 4/4] selftests: net: getsockopt_iter: add raw ICMP_FILTER coverage

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2026-07-01 21:55:34
Also in: linux-kselftest, lkml

Breno Leitao wrote:
Exercise the raw getsockopt path now backed by sockopt_t. ICMP_FILTER
returns a fixed-size struct and, unlike the int/u64 options already
covered, clamps the length down to the user buffer on a short read
instead of failing, so check that semantic explicitly along with the
exact and oversized cases, the -EOPNOTSUPP path on a non-ICMP raw
socket, and an unknown optname.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
+TEST_F(raw, icmpfilter_oversize_clamped)
+{
+	char buf[16] = {};
Not a reason to respin, but instead of a raw constant, something like
sizeof(struct icmp_filter) + 1 is more robust and descriptive.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help