From: Faisal Bukhari <faisalbukhari523@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, eddyz87@gmail.com, memxor@gmail.com,
shuah@kernel.org
Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] selftests/bpf: fix tunnel option size in ip6geneve_set_tunnel()
Date: Fri, 15 May 2026 20:48:30 +0530 [thread overview]
Message-ID: <20260515151830.711129-1-faisalbukhari523@gmail.com> (raw)
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
next reply other threads:[~2026-05-15 15:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 15:18 Faisal Bukhari [this message]
2026-05-15 15:37 ` [PATCH] selftests/bpf: fix tunnel option size in ip6geneve_set_tunnel() sashiko-bot
2026-05-15 16:01 ` bot+bpf-ci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260515151830.711129-1-faisalbukhari523@gmail.com \
--to=faisalbukhari523@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox