From: Jason Xing <kerneljasonxing@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
eddyz87@gmail.com, mykolal@fb.com, martin.lau@linux.dev,
song@kernel.org, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
haoluo@google.com, jolsa@kernel.org, shuah@kernel.org
Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
Jason Xing <kerneljasonxing@gmail.com>
Subject: [PATCH bpf-next v1 2/2] bpf: sockopt_sk: fix 'undeclared' definition error
Date: Tue, 4 Feb 2025 10:39:46 +0800 [thread overview]
Message-ID: <20250204023946.16031-3-kerneljasonxing@gmail.com> (raw)
In-Reply-To: <20250204023946.16031-1-kerneljasonxing@gmail.com>
Error messages:
selftests/bpf/prog_tests/sockopt_sk.c: In function ‘getsetsockopt’:
selftests/bpf/prog_tests/sockopt_sk.c:22:31: error: field ‘zc’ has incomplete type
struct tcp_zerocopy_receive zc;
^~
selftests/bpf/prog_tests/sockopt_sk.c:169:32: error: ‘TCP_ZEROCOPY_RECEIVE’ undeclared (first use in this function)
err = getsockopt(fd, SOL_TCP, TCP_ZEROCOPY_RECEIVE, &buf, &optlen);
^~~~~~~~~~~~~~~~~~~~
Fix it by introducing the right header.
Signed-off-by: Jason Xing <kerneljasonxing@gmail.com>
---
tools/testing/selftests/bpf/prog_tests/sockopt_sk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockopt_sk.c b/tools/testing/selftests/bpf/prog_tests/sockopt_sk.c
index ba6b3ec1156a..e0a9785ffcdc 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockopt_sk.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockopt_sk.c
@@ -2,7 +2,7 @@
#include <test_progs.h>
#include "cgroup_helpers.h"
-#include <netinet/tcp.h>
+#include <uapi/linux/tcp.h>
#include <linux/netlink.h>
#include "sockopt_sk.skel.h"
--
2.43.5
next prev parent reply other threads:[~2025-02-04 2:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 2:39 [PATCH bpf-next v1 0/2] selftests: fix two small compilation errors Jason Xing
2025-02-04 2:39 ` [PATCH bpf-next v1 1/2] bpf: changes_pkt_data: correct the 'main' error Jason Xing
2025-02-07 6:04 ` Martin KaFai Lau
2025-02-07 6:48 ` Jason Xing
2025-02-11 20:06 ` Martin KaFai Lau
2025-02-04 2:39 ` Jason Xing [this message]
2025-02-05 2:57 ` [PATCH bpf-next v1 2/2] bpf: sockopt_sk: fix 'undeclared' definition error Hou Tao
2025-02-05 3:27 ` Jason Xing
2025-02-05 9:30 ` Hou Tao
2025-02-05 9:38 ` Jason Xing
2025-02-11 19:40 ` Martin KaFai Lau
2025-02-11 7:52 ` [PATCH bpf-next v1 0/2] selftests: fix two small compilation errors Jason Xing
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=20250204023946.16031-3-kerneljasonxing@gmail.com \
--to=kerneljasonxing@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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