git: 769a6f803d1b - main - tcp_usrreq: Only allocate TFO counter when required
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Mar 2026 22:03:39 UTC
The branch main has been updated by pouria:
URL: https://cgit.FreeBSD.org/src/commit/?id=769a6f803d1b531d956af8d857e68f2d2d847324
commit 769a6f803d1b531d956af8d857e68f2d2d847324
Author: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
AuthorDate: 2026-03-24 17:54:46 +0000
Commit: Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-03-24 22:02:45 +0000
tcp_usrreq: Only allocate TFO counter when required
During tcp_usr_listen(), only allocate TFO counter when required.
Reviewed by: tuexen, glebius
Differential Revision: https://reviews.freebsd.org/D56067
---
sys/netinet/tcp_usrreq.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index aadcf0c9ce9c..b0a75127b124 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -396,10 +396,11 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td)
if (already_listening)
goto out;
- if (error == 0)
+ if (error == 0) {
in_pcblisten(inp);
- if (tp->t_flags & TF_FASTOPEN)
- tp->t_tfo_pending = tcp_fastopen_alloc_counter();
+ if (tp->t_flags & TF_FASTOPEN)
+ tp->t_tfo_pending = tcp_fastopen_alloc_counter();
+ }
out:
tcp_bblog_pru(tp, PRU_LISTEN, error);
@@ -460,12 +461,11 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td)
if (already_listening)
goto out;
- if (error == 0)
+ if (error == 0) {
in_pcblisten(inp);
- if (tp->t_flags & TF_FASTOPEN)
- tp->t_tfo_pending = tcp_fastopen_alloc_counter();
-
- if (error != 0)
+ if (tp->t_flags & TF_FASTOPEN)
+ tp->t_tfo_pending = tcp_fastopen_alloc_counter();
+ } else
inp->inp_vflag = vflagsav;
out: