diff options
author | Richard Scheffenegger <rscheff@FreeBSD.org> | 2022-01-27 17:59:21 +0000 |
---|---|---|
committer | Richard Scheffenegger <rscheff@FreeBSD.org> | 2022-01-30 10:41:16 +0000 |
commit | c3915f848b56221836bb95dfa293a43ca5f1e630 (patch) | |
tree | 611188f7154e32892f2e3fc3484bec950fc535b5 | |
parent | 15d6a1f03ba79dd264e3542ba83b3f701dedfdb3 (diff) | |
download | src-c3915f848b56221836bb95dfa293a43ca5f1e630.tar.gz src-c3915f848b56221836bb95dfa293a43ca5f1e630.zip |
tcp: Tidying up the conditionals for unwinding a spurious RTO
- Use the semantically correct TSTMP_xx macro when comparing
timestamps. (No functional change)
- check for bad retransmits only when TSopt is present in ACK
(don't assume there will be a valid TSopt in the TCP options struct)
- exclude tsecr == 0, since that most likely indicates an
invalid ts echo return (tsecr) value.
Reviewed By: tuexen, #transport
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34062
(cherry picked from commit 4531b3450b23a01de04b3bb393e475cf734793c8)
-rw-r--r-- | sys/netinet/tcp_input.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 0848afd3c2b0..2c7d15368483 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1653,9 +1653,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, to.to_tsecr -= tp->ts_offset; if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) to.to_tsecr = 0; - else if (tp->t_flags & TF_PREVVALID && - tp->t_rxtshift == 1 && - tp->t_badrxtwin != 0 && SEQ_LT(to.to_tsecr, tp->t_badrxtwin)) + else if (tp->t_rxtshift == 1 && + tp->t_flags & TF_PREVVALID && + tp->t_badrxtwin != 0 && + TSTMP_LT(to.to_tsecr, tp->t_badrxtwin)) cc_cong_signal(tp, th, CC_RTO_ERR); } /* @@ -1812,7 +1813,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if ((to.to_flags & TOF_TS) == 0 && tp->t_rxtshift == 1 && tp->t_flags & TF_PREVVALID && - (int)(ticks - tp->t_badrxtwin) < 0) { + tp->t_badrxtwin != 0 && + TSTMP_LT(ticks, tp->t_badrxtwin)) { cc_cong_signal(tp, th, CC_RTO_ERR); } @@ -2886,8 +2888,10 @@ process_ACK: */ if (tp->t_rxtshift == 1 && tp->t_flags & TF_PREVVALID && - tp->t_badrxtwin && - SEQ_LT(to.to_tsecr, tp->t_badrxtwin)) + tp->t_badrxtwin != 0 && + to.to_flags & TOF_TS && + to.to_tsecr != 0 && + TSTMP_LT(to.to_tsecr, tp->t_badrxtwin)) cc_cong_signal(tp, th, CC_RTO_ERR); /* |