tcp: remove unused code in tcp_usr_attach

pr_attach is only called on a socket (so) with so->so_listen != NULL
via sonewconn. However, sonewconn is not called from the TCP code.
The listening sockets are handled in tcp_syncache.c without using
sonewconn. Therefore, the code removed is never executed.
No functional change intended.

Reviewed by:		rrs, peter.lei_ieee.org
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D45412
This commit is contained in:
Michael Tuexen
2024-05-30 21:23:45 +02:00
parent a04ecddfc7
commit e7381521aa
-6
View File
@@ -179,12 +179,6 @@ tcp_usr_attach(struct socket *so, int proto, struct thread *td)
goto out;
}
tp->t_state = TCPS_CLOSED;
/* Can we inherit anything from the listener? */
if ((so->so_listen != NULL) &&
(so->so_listen->so_pcb != NULL) &&
(tp->t_fb->tfb_inherit != NULL)) {
(*tp->t_fb->tfb_inherit)(tp, sotoinpcb(so->so_listen));
}
tcp_bblog_pru(tp, PRU_ATTACH, error);
INP_WUNLOCK(inp);
TCPSTATES_INC(TCPS_CLOSED);