netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bpf: Remove duplicate tcp_filter hook in ipv6
@ 2017-06-09 19:17 Chenbo Feng
  2017-06-09 21:12 ` Eric Dumazet
  2017-06-10 20:08 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Chenbo Feng @ 2017-06-09 19:17 UTC (permalink / raw)
  To: netdev, David Miller; +Cc: Lorenzo Colitti, Eric Dumazet, Chenbo Feng

From: Chenbo Feng <fengc@google.com>

There are two tcp_filter hooks in tcp_ipv6 ingress path currently.
One is at tcp_v6_rcv and another is in tcp_v6_do_rcv. It seems the
tcp_filter() call inside tcp_v6_do_rcv is redundent and some packet
will be filtered twice in this situation. This will cause trouble
when using eBPF filters to account traffic data.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/tcp_ipv6.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 0840543..84ad502 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1249,9 +1249,6 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
 	if (skb->protocol == htons(ETH_P_IP))
 		return tcp_v4_do_rcv(sk, skb);
 
-	if (tcp_filter(sk, skb))
-		goto discard;
-
 	/*
 	 *	socket locking is here for SMP purposes as backlog rcv
 	 *	is currently called with bh processing disabled.
-- 
2.7.4

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

* Re: [PATCH net-next] bpf: Remove duplicate tcp_filter hook in ipv6
  2017-06-09 19:17 [PATCH net-next] bpf: Remove duplicate tcp_filter hook in ipv6 Chenbo Feng
@ 2017-06-09 21:12 ` Eric Dumazet
  2017-06-10 20:08 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2017-06-09 21:12 UTC (permalink / raw)
  To: Chenbo Feng; +Cc: netdev, David Miller, Lorenzo Colitti, Chenbo Feng

On Fri, Jun 9, 2017 at 12:17 PM, Chenbo Feng
<chenbofeng.kernel@gmail.com> wrote:
> From: Chenbo Feng <fengc@google.com>
>
> There are two tcp_filter hooks in tcp_ipv6 ingress path currently.
> One is at tcp_v6_rcv and another is in tcp_v6_do_rcv. It seems the
> tcp_filter() call inside tcp_v6_do_rcv is redundent and some packet
> will be filtered twice in this situation. This will cause trouble
> when using eBPF filters to account traffic data.
>
> Signed-off-by: Chenbo Feng <fengc@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>
> ---
>  net/ipv6/tcp_ipv6.c | 3 ---
>  1 file changed, 3 deletions(-)

Yes, this is the patch I agreed on ;)

Thanks

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

* Re: [PATCH net-next] bpf: Remove duplicate tcp_filter hook in ipv6
  2017-06-09 19:17 [PATCH net-next] bpf: Remove duplicate tcp_filter hook in ipv6 Chenbo Feng
  2017-06-09 21:12 ` Eric Dumazet
@ 2017-06-10 20:08 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-06-10 20:08 UTC (permalink / raw)
  To: chenbofeng.kernel; +Cc: netdev, lorenzo, edumazet, fengc

From: Chenbo Feng <chenbofeng.kernel@gmail.com>
Date: Fri,  9 Jun 2017 12:17:37 -0700

> From: Chenbo Feng <fengc@google.com>
> 
> There are two tcp_filter hooks in tcp_ipv6 ingress path currently.
> One is at tcp_v6_rcv and another is in tcp_v6_do_rcv. It seems the
> tcp_filter() call inside tcp_v6_do_rcv is redundent and some packet
> will be filtered twice in this situation. This will cause trouble
> when using eBPF filters to account traffic data.
> 
> Signed-off-by: Chenbo Feng <fengc@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied, thank you.

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

end of thread, other threads:[~2017-06-10 20:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-09 19:17 [PATCH net-next] bpf: Remove duplicate tcp_filter hook in ipv6 Chenbo Feng
2017-06-09 21:12 ` Eric Dumazet
2017-06-10 20:08 ` David Miller

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