]> Gentwo Git Trees - linux/.git/commit
selftests: net: add test for ipv6 fragmentation
authorBrett A C Sheffield <bacs@librecast.net>
Wed, 3 Sep 2025 15:46:01 +0000 (15:46 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 9 Sep 2025 09:43:59 +0000 (11:43 +0200)
commitaeb8d48ea92e6fd50dd4f973fb8778db86fbcc9f
treee5f0ae3c6a69e69647a8ff9fab87ab38edf0deef
parentd67ca09ca39f9605459959004b28c56899e3bca3
selftests: net: add test for ipv6 fragmentation

Add selftest for the IPv6 fragmentation regression which affected
several stable kernels.

Commit a18dfa9925b9 ("ipv6: save dontfrag in cork") was backported to
stable without some prerequisite commits.  This caused a regression when
sending IPv6 UDP packets by preventing fragmentation and instead
returning -1 (EMSGSIZE).

Add selftest to check for this issue by attempting to send a packet
larger than the interface MTU. The packet will be fragmented on a
working kernel, with sendmsg(2) correctly returning the expected number
of bytes sent.  When the regression is present, sendmsg returns -1 and
sets errno to EMSGSIZE.

Link: https://lore.kernel.org/stable/aElivdUXqd1OqgMY@karahi.gladserv.com
Signed-off-by: Brett A C Sheffield <bacs@librecast.net>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250903154925.13481-1-bacs@librecast.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/.gitignore
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/ipv6_fragmentation.c [new file with mode: 0644]