]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Test that dst is cleared on same-protocol encap
authorJakub Kicinski <kuba@kernel.org>
Sun, 29 Mar 2026 18:04:28 +0000 (11:04 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 30 Mar 2026 22:52:25 +0000 (15:52 -0700)
commit64c535db769e9ab917343d61045802e832d621ed
treee4f57c00846817ed5dd175c0f081132dcd5336a8
parent699f47e616fed11d5074e7bbee2f4f920028c4a2
selftests/bpf: Test that dst is cleared on same-protocol encap

Verify that bpf_skb_adjust_room() clears the routing dst even when
the encap L3 protocol matches the original packet (e.g. IPIP).
The dst selected for the inner packet is not valid for the
encapsulated result; a stale dst could lead to misrouting.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://patch.msgid.link/20260329180428.2657785-2-kuba@kernel.org
tools/testing/selftests/bpf/prog_tests/test_dst_clear.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_dst_clear.c [new file with mode: 0644]