]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/bpf: Test bpf_skb_check_mtu(BPF_MTU_CHK_SEGS) when transport_header is...
authorMartin KaFai Lau <martin.lau@kernel.org>
Wed, 12 Nov 2025 23:23:31 +0000 (15:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Feb 2026 22:59:47 +0000 (14:59 -0800)
commit5566ebcf41ae1b4bf67f857f8c46f4c413d97ad0
treef628dd03f988bd9831b12ae8a75625cfcd0a3864
parent73c2a1255f0fd318644c9d8022c7c023a2de1a36
selftests/bpf: Test bpf_skb_check_mtu(BPF_MTU_CHK_SEGS) when transport_header is not set

commit 6cc73f35406cae1f053e984e8de40e6dc9681446 upstream.

Add a test to check that bpf_skb_check_mtu(BPF_MTU_CHK_SEGS) is
rejected (-EINVAL) if skb->transport_header is not set. The test
needs to lower the MTU of the loopback device. Thus, take this
opportunity to run the test in a netns by adding "ns_" to the test
name. The "serial_" prefix can then be removed.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20251112232331.1566074-2-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/prog_tests/check_mtu.c
tools/testing/selftests/bpf/progs/test_check_mtu.c