summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2004-05-31 20:04:45 +0000
committerBrad Smith <brad@cvs.openbsd.org>2004-05-31 20:04:45 +0000
commit166821a034a36619d9c845545b90e5c17b31e2de (patch)
tree28c828ea9dec9a59a38ac959918c4171682faee5
parentf99ea54017de1993c6d61fed4966d0147c78858f (diff)
work around an LP64 problem where we report an excessively large window
due to incorrect mixing of types. From NetBSD ok cedric@ markus@
-rw-r--r--sys/netinet/tcp_output.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 587666bb879..7683013ce2f 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_output.c,v 1.67 2004/05/07 14:42:27 millert Exp $ */
+/* $OpenBSD: tcp_output.c,v 1.68 2004/05/31 20:04:44 brad Exp $ */
/* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */
/*
@@ -868,8 +868,8 @@ send:
win = 0;
if (win > (long)TCP_MAXWIN << tp->rcv_scale)
win = (long)TCP_MAXWIN << tp->rcv_scale;
- if (win < (long)(tp->rcv_adv - tp->rcv_nxt))
- win = (long)(tp->rcv_adv - tp->rcv_nxt);
+ if (win < (long)(int32_t)(tp->rcv_adv - tp->rcv_nxt))
+ win = (long)(int32_t)(tp->rcv_adv - tp->rcv_nxt);
if (flags & TH_RST)
win = 0;
th->th_win = htons((u_int16_t) (win>>tp->rcv_scale));