diff options
Diffstat (limited to 'sys/netinet')
| -rw-r--r-- | sys/netinet/tcp_input.c | 11 | ||||
| -rw-r--r-- | sys/netinet/tcp_reass.c | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 263dfd83f163..eef736cf34bc 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1859,13 +1859,12 @@ trimthenstep6: KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, ("dupacks not 1 or 2")); - if (tp->t_dupacks == 1) { + if (tp->t_dupacks == 1) tp->snd_limited = 0; - tp->snd_cwnd += tp->t_maxseg; - } else { - tp->snd_cwnd += - tp->t_maxseg * 2; - } + tp->snd_cwnd = + (tp->snd_nxt - tp->snd_una) + + (tp->t_dupacks - tp->snd_limited) * + tp->t_maxseg; (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 263dfd83f163..eef736cf34bc 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1859,13 +1859,12 @@ trimthenstep6: KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, ("dupacks not 1 or 2")); - if (tp->t_dupacks == 1) { + if (tp->t_dupacks == 1) tp->snd_limited = 0; - tp->snd_cwnd += tp->t_maxseg; - } else { - tp->snd_cwnd += - tp->t_maxseg * 2; - } + tp->snd_cwnd = + (tp->snd_nxt - tp->snd_una) + + (tp->t_dupacks - tp->snd_limited) * + tp->t_maxseg; (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { |
