Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet work around an LP64 problem where we report an e...



details:   https://anonhg.NetBSD.org/src/rev/a54a9baaf8cb
branches:  trunk
changeset: 566410:a54a9baaf8cb
user:      chs <chs%NetBSD.org@localhost>
date:      Sat May 08 14:41:47 2004 +0000

description:
work around an LP64 problem where we report an excessively large window
due to incorrect mixing of types.

diffstat:

 sys/netinet/tcp_output.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 9c0d66b5eb97 -r a54a9baaf8cb sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c  Sat May 08 14:39:01 2004 +0000
+++ b/sys/netinet/tcp_output.c  Sat May 08 14:41:47 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_output.c,v 1.111 2004/04/26 03:54:29 itojun Exp $  */
+/*     $NetBSD: tcp_output.c,v 1.112 2004/05/08 14:41:47 chs Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -138,7 +138,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.111 2004/04/26 03:54:29 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.112 2004/05/08 14:41:47 chs Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1043,8 +1043,8 @@
                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);
        th->th_win = htons((u_int16_t) (win>>tp->rcv_scale));
        if (SEQ_GT(tp->snd_up, tp->snd_nxt)) {
                u_int32_t urp = tp->snd_up - tp->snd_nxt;



Home | Main Index | Thread Index | Old Index