linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: cgroup: Fix build error without CONFIG_NET
@ 2019-07-02 13:29 YueHaibing
  2019-07-02 15:53 ` Stanislav Fomichev
  2019-07-02 16:01 ` Yonghong Song
  0 siblings, 2 replies; 9+ messages in thread
From: YueHaibing @ 2019-07-02 13:29 UTC (permalink / raw)
  To: ast, daniel, kafai, songliubraving, yhs, sdf
  Cc: linux-kernel, netdev, bpf, YueHaibing

If CONFIG_NET is not set, gcc building fails:

kernel/bpf/cgroup.o: In function `cg_sockopt_func_proto':
cgroup.c:(.text+0x237e): undefined reference to `bpf_sk_storage_get_proto'
cgroup.c:(.text+0x2394): undefined reference to `bpf_sk_storage_delete_proto'
kernel/bpf/cgroup.o: In function `__cgroup_bpf_run_filter_getsockopt':
(.text+0x2a1f): undefined reference to `lock_sock_nested'
(.text+0x2ca2): undefined reference to `release_sock'
kernel/bpf/cgroup.o: In function `__cgroup_bpf_run_filter_setsockopt':
(.text+0x3006): undefined reference to `lock_sock_nested'
(.text+0x32bb): undefined reference to `release_sock'

Add CONFIG_NET dependency to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init/Kconfig b/init/Kconfig
index e2e51b5..341cf2a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -998,6 +998,7 @@ config CGROUP_PERF
 config CGROUP_BPF
 	bool "Support for eBPF programs attached to cgroups"
 	depends on BPF_SYSCALL
+	depends on NET
 	select SOCK_CGROUP_DATA
 	help
 	  Allow attaching eBPF programs to a cgroup using the bpf(2)
-- 
2.7.4



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

end of thread, other threads:[~2019-07-08 15:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 13:29 [PATCH bpf-next] bpf: cgroup: Fix build error without CONFIG_NET YueHaibing
2019-07-02 15:53 ` Stanislav Fomichev
2019-07-02 16:04   ` Yonghong Song
2019-07-03  3:26     ` Yuehaibing
2019-07-03  8:26     ` [PATCH v2 " YueHaibing
2019-07-03 14:45       ` Yonghong Song
2019-07-08 15:26       ` Daniel Borkmann
2019-07-03  8:01   ` [PATCH " Yuehaibing
2019-07-02 16:01 ` Yonghong Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).