summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_timer.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2020-03-31 15:54:54 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2020-03-31 15:54:54 +0000
commit413c3db10102c265d9225f1f1610b37bb238d50a (patch)
treef3656d26f4f38a79f8f49acf55abfca74ef88b5f /sys/netinet/tcp_timer.c
parent11c7efe3a422cd7029326bddf7f2a1c6870a99fe (diff)
Notes
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r--sys/netinet/tcp_timer.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 6a98eb75d5e5..bd5f51c5bb90 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -614,6 +614,7 @@ tcp_timer_rexmt(void * xtp)
int rexmt;
struct inpcb *inp;
struct epoch_tracker et;
+ bool isipv6;
#ifdef TCPDEBUG
int ostate;
@@ -712,12 +713,16 @@ tcp_timer_rexmt(void * xtp)
* packets and process straight to FIN. In that case we won't catch
* ESTABLISHED state.
*/
- if (V_tcp_pmtud_blackhole_detect && (((tp->t_state == TCPS_ESTABLISHED))
- || (tp->t_state == TCPS_FIN_WAIT_1))) {
#ifdef INET6
- int isipv6;
+ isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? true : false;
+#else
+ isipv6 = false;
#endif
-
+ if (((V_tcp_pmtud_blackhole_detect == 1) ||
+ (V_tcp_pmtud_blackhole_detect == 2 && !isipv6) ||
+ (V_tcp_pmtud_blackhole_detect == 3 && isipv6)) &&
+ ((tp->t_state == TCPS_ESTABLISHED) ||
+ (tp->t_state == TCPS_FIN_WAIT_1))) {
/*
* Idea here is that at each stage of mtu probe (usually, 1448
* -> 1188 -> 524) should be given 2 chances to recover before
@@ -746,7 +751,6 @@ tcp_timer_rexmt(void * xtp)
* in an attempt to retransmit.
*/
#ifdef INET6
- isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? 1 : 0;
if (isipv6 &&
tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) {
/* Use the sysctl tuneable blackhole MSS. */