svn commit: r245783 - head/sys/netinet
Lawrence Stewart
lstewart at FreeBSD.org
Tue Jan 22 09:44:22 UTC 2013
Author: lstewart
Date: Tue Jan 22 09:44:21 2013
New Revision: 245783
URL: http://svnweb.freebsd.org/changeset/base/245783
Log:
Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited"
logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could
therefore potentially corrupt the result (although under normal operation,
neither variable should legitmately exceed 32 bits).
[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html
Submitted by: jhb
MFC after: 1 week
Modified:
head/sys/netinet/tcp_input.c
Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c Tue Jan 22 08:09:43 2013 (r245782)
+++ head/sys/netinet/tcp_input.c Tue Jan 22 09:44:21 2013 (r245783)
@@ -285,7 +285,7 @@ cc_ack_received(struct tcpcb *tp, struct
INP_WLOCK_ASSERT(tp->t_inpcb);
tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th);
- if (tp->snd_cwnd == min(tp->snd_cwnd, tp->snd_wnd))
+ if (tp->snd_cwnd <= tp->snd_wnd)
tp->ccv->flags |= CCF_CWND_LIMITED;
else
tp->ccv->flags &= ~CCF_CWND_LIMITED;
More information about the svn-src-all
mailing list