git: 2d99af941040 - main - tcp: remove check for condition that never happens
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 31 Jan 2025 22:24:39 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=2d99af941040548234c7945cc6d62c416bd9133c
commit 2d99af941040548234c7945cc6d62c416bd9133c
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-01-31 22:24:24 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-01-31 22:24:24 +0000
tcp: remove check for condition that never happens
A tcpcb in TCPS_LISTEN has always socket in SO_ACCEPTCONN. One block
above there is an assertion that proves that this never happens. We
stopped ever clearing SO_ACCEPTCONN back in 779f106aa169.
This reverts commit 982c1675ff8864f51007e0be402ead88429222bb.
Reviewed by: cc, markj
Differential Revision: https://reviews.freebsd.org/D48710
---
sys/netinet/tcp_input.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 03d493b1d7a9..647bcd17f7bc 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1354,15 +1354,6 @@ tfo_socket_result:
* Only the listen socket is unlocked by syncache_add().
*/
return (IPPROTO_DONE);
- } else if (tp->t_state == TCPS_LISTEN) {
- /*
- * When a listen socket is torn down the SO_ACCEPTCONN
- * flag is removed first while connections are drained
- * from the accept queue in a unlock/lock cycle of the
- * ACCEPT_LOCK, opening a race condition allowing a SYN
- * attempt go through unhandled.
- */
- goto dropunlock;
}
#if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE)
if (tp->t_flags & TF_SIGNATURE) {