[U-Boot-Users] [PATCH] in tftp client, recover from lost ACKs

Wolfgang Denk wd at denx.de
Mon Mar 13 00:57:03 CET 2006


In message <1122320333.17009.64.camel at wiseguy.symbium.com> you wrote:
> 
> * Patch by John McCarthy and Brenda J. Butler, 8 July 2005
>   When the tftp client sends an ack but it gets lost,
>   the server will resend the block.  The client was now
>   expecting the next block and ignored this block, the
>   server never got an ack, and they got stuck.  Now the
>   tftp client will ack the block the second (and subsequent)
>   time(s) allowing the tftp session to proceed.  This little
>   fix assumes that the server will resend exactly the same
>   contents (same size from same offset).

I understand what you're trying to fix, but  your  fix  doesn't  look
right to me:

> --- net/tftp.c  15 Mar 2005 17:53:28 -0000      1.1
> +++ net/tftp.c  5 Jul 2005 19:48:46 -0000       1.3
> @@ -246,17 +246,17 @@
>                         }
>                 }
> 
> -               if (TftpBlock == TftpLastBlock) {
> -                       /*
> -                        *      Same block again; ignore it.
> -                        */
> -                       break;
> -               }
> -
>                 TftpLastBlock = TftpBlock;

Note: here we set  TftpLastBlock = TftpBlock

>                 NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout);
> 
> -               store_block (TftpBlock - 1, pkt + 2, len);
> +               if (TftpBlock != TftpLastBlock) {

That means, that this condition will always be false.


Or am I missing something?


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Applying computer technology is simply finding the  right  wrench  to
pound in the correct screw.




More information about the U-Boot mailing list