tcp: no data on SYN segments unless doing TFO

Ensure that there is no data on SYN segments unless doing TFO.
This check is already in RACK and BBR.

Reported by:		glebius
Reviewed by:		rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44384

(cherry picked from commit af700f430fd86ba3eae63e587985a12436db8f69)
This commit is contained in:
Michael Tuexen 2024-03-22 11:12:56 +01:00
parent d69099e433
commit fd2a580db2

View file

@ -475,6 +475,12 @@ after_sack_rexmit:
(tp->t_tfo_client_cookie_len == 0)) ||
(flags & TH_RST)))
len = 0;
/* Without fast-open there should never be data sent on a SYN. */
if ((flags & TH_SYN) && !(tp->t_flags & TF_FASTOPEN)) {
len = 0;
}
if (len <= 0) {
/*
* If FIN has been sent but not acked,