diff options
author | tuexen <tuexen@FreeBSD.org> | 2018-04-07 15:16:57 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2018-04-07 15:16:57 +0000 |
commit | 0e33b519ad51daca0858360345f1031e4d183045 (patch) | |
tree | ff463bec8ec4a30a2a415dd91cf0d85c964307b9 | |
parent | 019644e64594f70d21fa0bfb04fcbbe8b4950650 (diff) | |
download | FreeBSD-src-0e33b519ad51daca0858360345f1031e4d183045.zip FreeBSD-src-0e33b519ad51daca0858360345f1031e4d183045.tar.gz |
MFC r322967:
Fix blackhole detection.
There were two bugs related to the blackhole detection:
* The smalles size was tried more than two times.
* The restored MSS was not the original one, but the second
candidate.
Sponsored by: Netflix, Inc.
-rw-r--r-- | sys/netinet/tcp_timer.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 099c952..429bd6d 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -687,18 +687,20 @@ tcp_timer_rexmt(void * xtp) */ if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) == (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) && - (tp->t_rxtshift >= 2 && tp->t_rxtshift % 2 == 0)) { + (tp->t_rxtshift >= 2 && tp->t_rxtshift < 6 && + tp->t_rxtshift % 2 == 0)) { /* * Enter Path MTU Black-hole Detection mechanism: * - Disable Path MTU Discovery (IP "DF" bit). * - Reduce MTU to lower value than what we * negotiated with peer. */ - /* Record that we may have found a black hole. */ - tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; - - /* Keep track of previous MSS. */ - tp->t_pmtud_saved_maxseg = tp->t_maxseg; + if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) == 0) { + /* Record that we may have found a black hole. */ + tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; + /* Keep track of previous MSS. */ + tp->t_pmtud_saved_maxseg = tp->t_maxseg; + } /* * Reduce the MSS to blackhole value or to the default @@ -757,7 +759,7 @@ tcp_timer_rexmt(void * xtp) * stage (1448, 1188, 524) 2 chances to recover. */ if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) && - (tp->t_rxtshift > 6)) { + (tp->t_rxtshift >= 6)) { tp->t_flags2 |= TF2_PLPMTU_PMTUD; tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; tp->t_maxseg = tp->t_pmtud_saved_maxseg; |