diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1866,7 +1866,13 @@ tcp_timer_activate(tp, TT_REXMT, TP_RXTCUR(tp)); sowwakeup(so); - if (sbavail(&so->so_snd)) + /* + * Only call tcp_output when there + * is new data available to be sent + * or we need to send an ACK. + */ + if (SEQ_GT(tp->snd_una + sbavail(&so->so_snd), + tp->snd_max) || tp->t_flags & TF_ACKNOW) (void) tcp_output(tp); goto check_delack; } @@ -2033,6 +2039,8 @@ tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN << tp->rcv_scale); tp->snd_una++; /* SYN is acked */ + if (SEQ_LT(tp->snd_nxt, tp->snd_una)) + tp->snd_nxt = tp->snd_una; /* * If not all the data that was sent in the TFO SYN * has been acked, resend the remainder right away.