[PATCH bpf-next v1 2/2] bpf: sockopt_sk: fix 'undeclared' definition error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux