BPF List
 help / color / mirror / Atom feed
* [PATCH] selftests/bpf: fix tunnel option size in ip6geneve_set_tunnel()
@ 2026-05-15 15:18 Faisal Bukhari
  2026-05-15 15:37 ` sashiko-bot
  2026-05-15 16:01 ` bot+bpf-ci
  0 siblings, 2 replies; 3+ messages in thread
From: Faisal Bukhari @ 2026-05-15 15:18 UTC (permalink / raw)
  To: ast, daniel, andrii, martin.lau, eddyz87, memxor, shuah
  Cc: bpf, linux-kselftest, linux-kernel

Pass the correct size to bpf_skb_set_tunnel_opt() in
ip6geneve_set_tunnel().

sizeof(gopt) returns the size of the pointer instead of the
actual Geneve option structure, resulting in an incorrect
option length being passed to the helper. Use
sizeof(local_gopt) to provide the proper structure size.

Signed-off-by: Faisal Bukhari <faisalbukhari523@gmail.com>
---
 tools/testing/selftests/bpf/progs/test_tunnel_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c
index 30f1de458669d..ca04d1d1ade4e 100644
--- a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c
+++ b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c
@@ -674,7 +674,7 @@ int ip6geneve_set_tunnel(struct __sk_buff *skb)
 	gopt->length = 2; /* 4-byte multiple */
 	*(int *) &gopt->opt_data = bpf_htonl(0xfeedbeef);
 
-	ret = bpf_skb_set_tunnel_opt(skb, gopt, sizeof(gopt));
+	ret = bpf_skb_set_tunnel_opt(skb, gopt, sizeof(local_gopt));
 	if (ret < 0) {
 		log_err(ret);
 		return TC_ACT_SHOT;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-15 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 15:18 [PATCH] selftests/bpf: fix tunnel option size in ip6geneve_set_tunnel() Faisal Bukhari
2026-05-15 15:37 ` sashiko-bot
2026-05-15 16:01 ` bot+bpf-ci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox