bpf: cgroup: Fix build error without CONFIG_NET
authorYueHaibing <yuehaibing@huawei.com>
Wed, 3 Jul 2019 08:26:30 +0000 (16:26 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Jul 2019 15:17:00 +0000 (17:17 +0200)
commit6705fea0c799a4efb9a9ce2968a2f7a570e33dc2
tree51319bf5aa8bfa79062479dd1c2a1d33fc90364f
parent06ec0e2c490afd2f870d89c59200540fd9acde95
bpf: cgroup: Fix build error without CONFIG_NET

If CONFIG_NET is not set and CONFIG_CGROUP_BPF=y,
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'

Reported-by: Hulk Robot <hulkci@huawei.com>
Suggested-by: Stanislav Fomichev <sdf@fomichev.me>
Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/cgroup.c