bpf: Fix build error without CONFIG_NET
Subsystems (6)
PATCH 1/1 bpf: Fix build error without CONFIG_NET
If CONFIG_NET is n, building fails:
kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'
Wrap it into a #ifdef to fix this.
--- kernel/trace/bpf_trace.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/trace/bpf_trace.c +2 -0
@@ -1055,8 +1055,10 @@ raw_tp_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)switch (func_id) {case BPF_FUNC_perf_event_output:return &bpf_perf_event_output_proto_raw_tp; +#ifdef CONFIG_NET case BPF_FUNC_skb_output:return &bpf_skb_output_proto; +#endif case BPF_FUNC_get_stackid:return &bpf_get_stackid_proto_raw_tp;case BPF_FUNC_get_stack:
Signature · 1 line
2.7.4
Quoted 10 lines · YueHaibing
If
CONFIG_NETis n, building fails:
kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'Wrap it into a #ifdef to fix this.
Reported-by Hulk Robot <[email protected]>Fixes a7658e1a4164 ("bpf: Check types of arguments passed into helpers")Signed-off-by YueHaibing <[email protected]>
Quoted 20 lines
--- kernel/trace/bpf_trace.c | 2 ++ 1 file changed, 2 insertions(+)kernel/trace/bpf_trace.c +2
-0@@ -1055,8 +1055,10 @@ raw_tp_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)switch (func_id) {case BPF_FUNC_perf_event_output:return &bpf_perf_event_output_proto_raw_tp; +#ifdef CONFIG_NET case BPF_FUNC_skb_output:return &bpf_skb_output_proto; +#endif case BPF_FUNC_get_stackid:return &bpf_get_stackid_proto_raw_tp;case BPF_FUNC_get_stack:
Steven Rostedt
maintainerQuoted 6 lines · On Fri, 18 Oct 2019 18:11:07 +0000 Yonghong Song <[email protected]> wrote:
Quoted 5 lines · YueHaibing
If
CONFIG_NETis n, building fails:
kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'
Quoted 7 lines
Quoted 5 lines
Wrap it into a #ifdef to fix this.
Reported-by Hulk Robot <[email protected]>Fixes a7658e1a4164 ("bpf: Check types of arguments passed into helpers")Signed-off-by YueHaibing <[email protected]>Acked-by Yonghong Song <[email protected]>
I'm getting ready for another push to Linus. Want me to pull this into my tree?
-- Steve
Daniel Borkmann
maintainerQuoted 10 lines · Steven Rostedt
Quoted 8 lines · On Fri, 18 Oct 2019 18:11:07 +0000 Yonghong Song <[email protected]> wrote:
Quoted 7 lines · YueHaibing
If
CONFIG_NETis n, building fails:
kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'Wrap it into a #ifdef to fix this.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Reported-by Hulk Robot <[email protected]>Fixes a7658e1a4164 ("bpf: Check types of arguments passed into helpers")Signed-off-by YueHaibing <[email protected]>Acked-by Yonghong Song <[email protected]>I'm getting ready for another push to Linus. Want me to pull this into my tree?
It's related to bpf-next, so only bpf-next is appropriate here. We'll take it.
Thanks,
Daniel
Steven Rostedt
maintainerQuoted 2 lines · On Fri, 18 Oct 2019 20:46:29 +0200 Daniel Borkmann <[email protected]> wrote:
It's related to bpf-next, so only bpf-next is appropriate here. We'll take it.
OK, thanks!
-- Steve
Quoted 10 lines · YueHaibing
If
CONFIG_NETis n, building fails:
kernel/trace/bpf_trace.o: In function `raw_tp_prog_func_proto':
bpf_trace.c:(.text+0x1a34): undefined reference to `bpf_skb_output_proto'Wrap it into a #ifdef to fix this.
Reported-by Hulk Robot <[email protected]>Fixes a7658e1a4164 ("bpf: Check types of arguments passed into helpers")Signed-off-by YueHaibing <[email protected]>
Applied, thanks!