Subject: Re: 32/64 sign-extension bug in TCP
To: None <ragge@ludd.luth.se>
From: Chuck Silvers <chuq@chuq.com>
List: tech-net
Date: 05/03/2004 07:34:34
On Mon, May 03, 2004 at 04:05:09PM +0200, ragge@ludd.luth.se wrote:
> > 
> > the attached diff fixes this for me, by using replacing "long" with "int"
> > in tcp_output.c and removing several casts that become unnecessary.
> > does anyone see any problem with this change?  post 2.0, it would be good
> > to eliminate "long" from the rest of the TCP code, but I'd rather stick
> > with a smaller change for now.
> > 
> Wouldn't it be better to replace it with int32_t instead?  Not that I
> think any 16-bit machines uses our IP stack and therefore would fail
> if changed long->int, but it would not hurt to use a fixed-size type.

the TCP code already assumes that int is 32 bits in many places,
I'm just going with the flow.  I agree that it would be better to use
fixed-size types throughout for variables that really want to be
a particular size, but I'd rather do that after 2.0.

-Chuck