summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-06-16 19:00:12 +0000
committerjhb <jhb@FreeBSD.org>2009-06-16 19:00:12 +0000
commit8869d432a2258b351ac462613e9dc2ff6fad6124 (patch)
treedb55da8ef9941c8dbd81dba4814590bc7fcffda1 /sys/netinet/tcp_input.c
parent43c09e3d009062ccaa9dc975306c4a8963eb8536 (diff)
downloadFreeBSD-src-8869d432a2258b351ac462613e9dc2ff6fad6124.zip
FreeBSD-src-8869d432a2258b351ac462613e9dc2ff6fad6124.tar.gz
Fix edge cases with ticks wrapping from INT_MAX to INT_MIN in the handling
of the per-tcpcb t_badtrxtwin. Submitted by: bde
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 6bfb723..371dd1ef 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1296,7 +1296,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
* "bad retransmit" recovery.
*/
if (tp->t_rxtshift == 1 &&
- ticks < tp->t_badrxtwin) {
+ (int)(ticks - tp->t_badrxtwin) < 0) {
TCPSTAT_INC(tcps_sndrexmitbad);
tp->snd_cwnd = tp->snd_cwnd_prev;
tp->snd_ssthresh =
@@ -2253,7 +2253,7 @@ process_ACK:
* original cwnd and ssthresh, and proceed to transmit where
* we left off.
*/
- if (tp->t_rxtshift == 1 && ticks < tp->t_badrxtwin) {
+ if (tp->t_rxtshift == 1 && (int)(ticks - tp->t_badrxtwin) < 0) {
TCPSTAT_INC(tcps_sndrexmitbad);
tp->snd_cwnd = tp->snd_cwnd_prev;
tp->snd_ssthresh = tp->snd_ssthresh_prev;
OpenPOWER on IntegriCloud