Skip to contentSkip to conversation

tcp: no need to use acceptable for conn_request

PATCH Applied Jason Xing 4 participants 4 messages Feb 13, 2024 – Feb 15, 2024

Subsystems (3)
lore
Share & tools
lore

Jason Xing

author
#0 lore raw

PATCH 1/1 tcp: no need to use acceptable for conn_request

From: Jason Xing <[email protected]>

Since tcp_conn_request() always returns zero, there is no need to keep the dead code. Remove it then.

---
 net/ipv4/tcp_input.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
net/ipv4/tcp_input.c +1 -4
index 2d20edf652e6..b1c4462a0798 100644
@@ -6623,7 +6623,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
 	const struct tcphdr *th = tcp_hdr(skb);
 	struct request_sock *req;
 	int queued = 0;
-	bool acceptable;
 	SKB_DR(reason);
 
 	switch (sk->sk_state) {
@@ -6649,12 +6648,10 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
 			 */
 			rcu_read_lock();
 			local_bh_disable();
-			acceptable = icsk->icsk_af_ops->conn_request(sk, skb) >= 0;
+			icsk->icsk_af_ops->conn_request(sk, skb);
 			local_bh_enable();
 			rcu_read_unlock();
 
-			if (!acceptable)
-				return 1;
 			consume_skb(skb);
 			return 0;
 		}
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jason Xing

From: Jason Xing <[email protected]>
Date: Tue, 13 Feb 2024 21:12:05 +0800

Quoted 8 lines

From: Jason Xing <[email protected]>

Since tcp_conn_request() always returns zero, there is no need to keep the dead code. Remove it then.

Quoted 32 lines
---
 net/ipv4/tcp_input.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
net/ipv4/tcp_input.c +1 -4
index 2d20edf652e6..b1c4462a0798 100644
@@ -6623,7 +6623,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
 	const struct tcphdr *th = tcp_hdr(skb);
 	struct request_sock *req;
 	int queued = 0;
-	bool acceptable;
 	SKB_DR(reason);
 
 	switch (sk->sk_state) {
@@ -6649,12 +6648,10 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
 			 */
 			rcu_read_lock();
 			local_bh_disable();
-			acceptable = icsk->icsk_af_ops->conn_request(sk, skb) >= 0;
+			icsk->icsk_af_ops->conn_request(sk, skb);
 			local_bh_enable();
 			rcu_read_unlock();
 
-			if (!acceptable)
-				return 1;
 			consume_skb(skb);
 			return 0;
 		}
Signature · 1 line
2.37.3
#3 lore raw
In reply to Jason Xing
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Tue, 13 Feb 2024 21:12:05 +0800 you wrote:

From: Jason Xing <[email protected]>

Since tcp_conn_request() always returns zero, there is no need to keep the dead code. Remove it then.

[...]

Here is the summary with links:
- [net-next] tcp: no need to use acceptable for conn_request

    https://git.kernel.org/netdev/net-next/c/d25f32722f50

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html