All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] TFTP failure with variable block size on little endian systems
@ 2007-08-20 19:25 stefano babic
  0 siblings, 0 replies; only message in thread
From: stefano babic @ 2007-08-20 19:25 UTC (permalink / raw)
  To: u-boot

Hi all,

I have problems using the last version of the TFTP client. I am not 
using the multicast feature (CONFIG_MCAST_TFTP is not set), but the 
transfer stops after some packets, even the correct filesize is displayed.

I enabled ET_DEBUG and I have seen that the blocksize is greater that 
the MTU:

Load address: 0xa0100000
Loading: send option "timeout 5"
Got OACK: timeout 5
Blocksize ack: 48133, 48133
####
done
Bytes transferred = 1836864 (1c0740 hex)

Really the transfer was not completed and only a part of the requested 
file was downloaded on my board :(
I checked thetraffic with wireshark and the board sends a TFTP Read 
Request with blksize=48133 (and the server does not complain, too !).

The problem is related to the code:

                 /* try for more effic. blk size */
                 pkt += sprintf((char *)pkt,"blksize%c%d%c",
                                 0,htons(TftpBlkSizeOption),0);

We do not need the htons() call because we are simply writing into a 
buffer. I changed the code into:
                                 0,TftpBlkSizeOption,0);

and everything works again. So the problem should happen on all little 
endian systems (in my case, a PXA270).

stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-20 19:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 19:25 [U-Boot-Users] TFTP failure with variable block size on little endian systems stefano babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.