summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_timer.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2017-08-28 11:41:18 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2017-08-28 11:41:18 +0000
commit3d5af7a1278f7b10d62b1b93b5383e38958400e1 (patch)
tree767eb9d2fac836fb891f8d092f89bd6836a9f534 /sys/netinet/tcp_timer.c
parent5d17a1d629b34f7c5409adb073b5d34caecbbe74 (diff)
Notes
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r--sys/netinet/tcp_timer.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 69e71241dd69..04e0f9cd216c 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -726,18 +726,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
@@ -796,7 +798,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;