tftp fix for eCos applications
Barton Meeks
bartonm2002@yahoo.com
Thu Mar 13 01:17:00 GMT 2003
Looks like I found and fixed something that had
already been fixed for redboot. When I tried to tftp
from my application, it only worked with 2 out of 4
tftp servers that I tried. One of the programs
produced this (winsock?) error: "RecvFrom returns
10040", and described this as a datagram that was
larger than the buffer reserved for it. I traced this
to the initial tftp request message, which was much
larger coming from my application than a similar
request from linux tftp.
I changed the sendto's in tftp_get and tftp_put (file:
tftp_client.c) from:
if (sendto(s, data, sizeof(data), 0,
to
if (sendto(s, data, (int)(cp - data), 0,
In redboot, the change had already been made to:
if (__udp_sendto(tftp_stream.data, cp-(char
*)hdr,
These changes cause the request to only send the
defined packet, instead of sending the full 512 byte
buffer.
I'm not a skilled "patch maker", but I have included
one incase the above doesn't explain things well
enough.
By the way, the two tftp servers that worked with the
large inital request packet were RedHat Linux and
Pumpkin for Windows. The ones that failed were an
internal product and tftpd32. Pumpkin and tftpd32 were
found at http://www.nonags.com, which is a good place
for windows freeware.
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tftp-patch.txt
URL: <http://sourceware.org/pipermail/ecos-patches/attachments/20030313/e19cb7ee/attachment.txt>
More information about the Ecos-patches
mailing list