]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/net: expand cmsg_ipv6.sh with ipv4
authorWillem de Bruijn <willemb@google.com>
Tue, 25 Feb 2025 02:23:59 +0000 (21:23 -0500)
committerJakub Kicinski <kuba@kernel.org>
Thu, 27 Feb 2025 02:59:00 +0000 (18:59 -0800)
commit2e5584e0f913b53630238223443ae2a67eea714c
tree95982bef71501e3f3a5e4e11609e7e3d5e3b4eab
parentc1d6d629ab0b3dd991c7fb04587dd2adf2c4b426
selftests/net: expand cmsg_ipv6.sh with ipv4

Expand IPV6_TCLASS to also cover IP_TOS.
Expand IPV6_HOPLIMIT to also cover IP_TTL.

Expand csmg_sender.c to allow setting IPv4 setsockopts.
Also rename struct v6 to cmsg to match its expanded scope.
Don't bother updating all occurrences of tclass and hoplimit.

Rename cmsg_ipv6.sh to cmsg_ip.sh to match the expanded scope.

Be careful around the subtle API difference between TCLASS and TOS.
IP_TOS includes ECN bits. Add a test to verify that these are masked
when making routing decisions.

Diff is more concise with --word-diff

Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250225022431.2083926-3-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/cmsg_ip.sh [moved from tools/testing/selftests/net/cmsg_ipv6.sh with 65% similarity]
tools/testing/selftests/net/cmsg_sender.c