Bug 17772

Summary: TFTP can not handle big files (> 32MBytes)
Product: Base System Reporter: ph.jounin <ph.jounin>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description ph.jounin 2000-04-03 13:50:01 UTC
A big file (more than 32MBytes) can not been downloaded/uploaded 
whith the current TFTP client.
After sending/receiving the segment #65535, TFTP waits for the segment
#65536 which can not be produced, since TFTP protocol reserves only 
2 bytes for packet number.

I have not checked if the TFTP server has the same limitation.

Fix: 

The following lines in the file /usr.bin/tftp/tftp.c should 
include u_short cast :
165, 176, 269, 279

For instance
if (ap->th_block == (block-1)) {
should be fixed in
if (ap->th_block == (u_short) (block-1)) {
How-To-Repeat: Transfer a big file and use a correct TFTP server.
Comment 1 Mike Heffner freebsd_committer freebsd_triage 2001-06-16 16:19:31 UTC
State Changed
From-To: open->closed

Fixed in rev 1.6 of tftp.c.