diff options
author | Richard Procter <procter@cvs.openbsd.org> | 2020-06-19 22:47:23 +0000 |
---|---|---|
committer | Richard Procter <procter@cvs.openbsd.org> | 2020-06-19 22:47:23 +0000 |
commit | 02018eefc6801b9abbc976bd3ea63ba37dce9df4 (patch) | |
tree | f803f11b063ef1a8f3d5c4c813c110ce5dbc8fbd /sys/netinet | |
parent | c7a035330699c00a3e653294e4a9a41b4faf5769 (diff) |
Break a glass ceiling on cwnd due to integer division during congestion
avoidance. The problem and fix is noted in RFC5681 section 3.1, page 7.
Report, diff and testing from Brian Brombacher, thanks!
Testing and a cosmetic tweak by myself.
ok claudio
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 5da77b915ae..1d8fae4c560 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.364 2019/12/06 14:43:14 tobhe Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.365 2020/06/19 22:47:22 procter Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -1708,7 +1708,7 @@ trimthenstep6: u_int incr = tp->t_maxseg; if (cw > tp->snd_ssthresh) - incr = incr * incr / cw; + incr = max(incr * incr / cw, 1); if (tp->t_dupacks < tcprexmtthresh) tp->snd_cwnd = ulmin(cw + incr, TCP_MAXWIN << tp->snd_scale); |