public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: stefano babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] TFTP failure with variable block size on little endian systems
Date: Mon, 20 Aug 2007 21:25:37 +0200	[thread overview]
Message-ID: <46C9EAB1.7050707@denx.de> (raw)

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
=====================================================================

                 reply	other threads:[~2007-08-20 19:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46C9EAB1.7050707@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox