bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] bpf: fix net/core/filter build errors when INET is not enabled
@ 2020-06-30 17:29 Randy Dunlap
  2020-06-30 17:49 ` Yonghong Song
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2020-06-30 17:29 UTC (permalink / raw)
  To: LKML, netdev, bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, John Fastabend, KP Singh,
	David Miller

From: Randy Dunlap <rdunlap@infradead.org>

Fix build errors when CONFIG_INET is not set/enabled.

(.text+0x2b1b): undefined reference to `tcp_prot'
(.text+0x2b3b): undefined reference to `tcp_prot'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@chromium.org>
Cc: netdev@vger.kernel.org
Cc: bpf@vger.kernel.org
---
 net/core/filter.c |    4 ++++
 1 file changed, 4 insertions(+)

--- linux-next-20200630.orig/net/core/filter.c
+++ linux-next-20200630/net/core/filter.c
@@ -9328,8 +9328,10 @@ const struct bpf_func_proto bpf_skc_to_t
 
 BPF_CALL_1(bpf_skc_to_tcp_timewait_sock, struct sock *, sk)
 {
+#ifdef CONFIG_INET
 	if (sk->sk_prot == &tcp_prot && sk->sk_state == TCP_TIME_WAIT)
 		return (unsigned long)sk;
+#endif
 
 #if IS_BUILTIN(CONFIG_IPV6)
 	if (sk->sk_prot == &tcpv6_prot && sk->sk_state == TCP_TIME_WAIT)
@@ -9350,8 +9352,10 @@ const struct bpf_func_proto bpf_skc_to_t
 
 BPF_CALL_1(bpf_skc_to_tcp_request_sock, struct sock *, sk)
 {
+#ifdef CONFIG_INET
 	if (sk->sk_prot == &tcp_prot  && sk->sk_state == TCP_NEW_SYN_RECV)
 		return (unsigned long)sk;
+#endif
 
 #if IS_BUILTIN(CONFIG_IPV6)
 	if (sk->sk_prot == &tcpv6_prot && sk->sk_state == TCP_NEW_SYN_RECV)


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

* Re: [PATCH -next] bpf: fix net/core/filter build errors when INET is not enabled
  2020-06-30 17:29 [PATCH -next] bpf: fix net/core/filter build errors when INET is not enabled Randy Dunlap
@ 2020-06-30 17:49 ` Yonghong Song
  2020-07-01 15:40   ` Alexei Starovoitov
  0 siblings, 1 reply; 3+ messages in thread
From: Yonghong Song @ 2020-06-30 17:49 UTC (permalink / raw)
  To: Randy Dunlap, LKML, netdev, bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Andrii Nakryiko, John Fastabend, KP Singh, David Miller



On 6/30/20 10:29 AM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Fix build errors when CONFIG_INET is not set/enabled.
> 
> (.text+0x2b1b): undefined reference to `tcp_prot'
> (.text+0x2b3b): undefined reference to `tcp_prot'
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Martin KaFai Lau <kafai@fb.com>
> Cc: Song Liu <songliubraving@fb.com>
> Cc: Yonghong Song <yhs@fb.com>
> Cc: Andrii Nakryiko <andriin@fb.com>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Cc: KP Singh <kpsingh@chromium.org>
> Cc: netdev@vger.kernel.org
> Cc: bpf@vger.kernel.org

Thanks for the fix!

Acked-by: Yonghong Song <yhs@fb.com>

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

* Re: [PATCH -next] bpf: fix net/core/filter build errors when INET is not enabled
  2020-06-30 17:49 ` Yonghong Song
@ 2020-07-01 15:40   ` Alexei Starovoitov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2020-07-01 15:40 UTC (permalink / raw)
  To: Yonghong Song
  Cc: Randy Dunlap, LKML, netdev, bpf, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Andrii Nakryiko,
	John Fastabend, KP Singh, David Miller

On Tue, Jun 30, 2020 at 10:50 AM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 6/30/20 10:29 AM, Randy Dunlap wrote:
> > From: Randy Dunlap <rdunlap@infradead.org>
> >
> > Fix build errors when CONFIG_INET is not set/enabled.
> >
> > (.text+0x2b1b): undefined reference to `tcp_prot'
> > (.text+0x2b3b): undefined reference to `tcp_prot'
> >
> > Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> > Cc: Alexei Starovoitov <ast@kernel.org>
> > Cc: Daniel Borkmann <daniel@iogearbox.net>
> > Cc: Martin KaFai Lau <kafai@fb.com>
> > Cc: Song Liu <songliubraving@fb.com>
> > Cc: Yonghong Song <yhs@fb.com>
> > Cc: Andrii Nakryiko <andriin@fb.com>
> > Cc: John Fastabend <john.fastabend@gmail.com>
> > Cc: KP Singh <kpsingh@chromium.org>
> > Cc: netdev@vger.kernel.org
> > Cc: bpf@vger.kernel.org
>
> Thanks for the fix!
>
> Acked-by: Yonghong Song <yhs@fb.com>

Applied. Thanks

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

end of thread, other threads:[~2020-07-01 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30 17:29 [PATCH -next] bpf: fix net/core/filter build errors when INET is not enabled Randy Dunlap
2020-06-30 17:49 ` Yonghong Song
2020-07-01 15:40   ` Alexei Starovoitov

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).