Subject: Re: bin/10076: 16MB limit in tftp / tftpd
To: None <netbsd-bugs@netbsd.org>
From: Geoff Wing <mason@primenet.com.au>
List: netbsd-bugs
Date: 05/09/2000 00:16:10
Reinoud Zandijk <reinoud@rangerover.netbsd.org> typed:
:Every tftp request made for a file bigger than 16Mb, the transfer stops
:when the 16Mb is reached ... this is due to the block counter.
:This counter is a signed short in the protocol, and so the maximum number

The protocol specifies ``2 bytes'' using ``8 bit bytes''.

:of blocks is 16Mb/512 bytes =  32768 and will then wrap to a
:negative number. Since the tftpd deamon and the tftp client also keep a
:counter for block numbering and is declared as an `int',
:this counter won't wrap and thus breaking the protocol, for it can't
:resynchronise anymore

:>Fix:
:Patching the following files by changing the type of the `block' counter
:from `int' to `signed short' :

It would probably disambiguate more if you used   int16_t  (even though
int16_t == short at the moment on all our platforms)

Regards,
-- 
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874