tcp: add some debug output

Also log, when dropping text or FIN after having received a FIN.
This is the intended behavior described in RFC 9293.
A follow-up patch will enforce this behavior for the base stack
and the RACK stack.
Reviewed by:		rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44669

(cherry picked from commit e8c149ab85)
This commit is contained in:
Michael Tuexen 2024-04-07 22:41:24 +02:00
parent 90cde57af8
commit 5344772af9

View file

@ -3251,6 +3251,35 @@ dodata: /* XXX */
len = so->so_rcv.sb_hiwat;
#endif
} else {
if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
if (tlen > 0) {
if ((thflags & TH_FIN) != 0) {
log(LOG_DEBUG, "%s; %s: %s: "
"Received %d bytes of data and FIN "
"after having received a FIN, "
"just dropping both\n",
s, __func__,
tcpstates[tp->t_state], tlen);
} else {
log(LOG_DEBUG, "%s; %s: %s: "
"Received %d bytes of data "
"after having received a FIN, "
"just dropping it\n",
s, __func__,
tcpstates[tp->t_state], tlen);
}
} else {
if ((thflags & TH_FIN) != 0) {
log(LOG_DEBUG, "%s; %s: %s: "
"Received FIN "
"after having received a FIN, "
"just dropping it\n",
s, __func__,
tcpstates[tp->t_state]);
}
}
free(s, M_TCPLOG);
}
m_freem(m);
thflags &= ~TH_FIN;
}