*BSD News Article 92305


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.Hawaii.Edu!news.lava.net!nntp.reed.edu!usenet.cat.pdx.edu!newsrelay.netins.net!news.ececs.uc.edu!newsfeeds.sol.net!worldnet.att.net!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!cam-news-feed2.bbnplanet.com!news.shiva.com!usenet
From: John Shriver <jas@shiva.com>
Newsgroups: comp.bugs.4bsd
Subject: TFTP bugs on files > 16 MB
Date: Fri, 28 Mar 1997 16:49:19 -0500
Organization: Shiva Corporation
Lines: 9
Message-ID: <333C3CDF.372A@shiva.com>
NNTP-Posting-Host: brill
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.02 (X11; I; SunOS 5.5.1 sun4m)
Xref: euryale.cc.adfa.oz.au comp.bugs.4bsd:2169

Both in usr.lib/tftp/tftp.c and libexec/tftpd/tftpd.c, the block numbers are
stored as type "int".  That makes the protocol crap out after block 32767, since
it interprets block 32768 as -32768, and gets very unhappy.  The largest file
that transfers right is 16 MB.

It appears that the type of the variable block in sendfile() and recvfile()
needs to be changed to a "u_short" to fix this.  This will get you past the sign
bug to 32 MB files, and should provide mod-65536 operation to get you past 32 MB
files.