Skip to contentSkip to conversation

bpf: Remove duplicate tcp_filter hook in ipv6

PATCH Applied Chenbo Feng 3 participants 3 messages Jun 9, 2017 – Jun 10, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: Remove duplicate tcp_filter hook in ipv6

From: Chenbo Feng <[email protected]>

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.

---
 net/ipv6/tcp_ipv6.c | 3 ---
 1 file changed, 3 deletions(-)
net/ipv6/tcp_ipv6.c +0 -3
index 0840543..84ad502 100644
@@ -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.
Signature · 1 line
2.7.4
#1 lore raw
Quoted 8 lines · Chenbo Feng

From: Chenbo Feng <[email protected]>

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.

Quoted 5 lines
---
 net/ipv6/tcp_ipv6.c | 3 ---
 1 file changed, 3 deletions(-)

Yes, this is the patch I agreed on ;)

Thanks

maintainer Applied
#2 lore raw
In reply to Chenbo Feng

From: Chenbo Feng <[email protected]>
Date: Fri, 9 Jun 2017 12:17:37 -0700

Quoted 10 lines

From: Chenbo Feng <[email protected]>

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.

Applied, thank you.