[BusyBox-cvs] svn commit: trunk/busybox/networking

landley at busybox.net landley at busybox.net
Tue Jun 7 02:40:40 UTC 2005


Author: landley
Date: 2005-06-06 20:40:39 -0600 (Mon, 06 Jun 2005)
New Revision: 10477

Log:
Thus spake Brenda J. Butler:

We were seeing some timeouts when getting files with the busybox tftp
client.

With tcpdump, we saw that the tftp client was receiving blocks and
ack'ing them, but the server was failing to receive the occasional
ack.

When that happened, the server would send the last block over again,
but the tftp client was expecting the next block.

This patch allows the client to recover from this situation
(it sends an ack for the repeat block but does not write it
to the local file).

I hope it meets your approval, please don't hesitate to send
me comments for improvement.

The patch is against "head" in svn, I tested it on an older version
of busybox in our environment.  It applied cleanly to the older
version.

Credit for this goes to my co-worker John McCarthy for finding
it and me for fixing it (assuming it works for everyone else too).

cheerio,
bjb



Modified:
   trunk/busybox/networking/tftp.c


Changeset:
Modified: trunk/busybox/networking/tftp.c
===================================================================
--- trunk/busybox/networking/tftp.c	2005-06-07 00:58:04 UTC (rev 10476)
+++ trunk/busybox/networking/tftp.c	2005-06-07 02:40:39 UTC (rev 10477)
@@ -458,6 +458,12 @@
 				opcode = TFTP_ACK;
 				continue;
 			}
+			/* in case the last ack disappeared into the ether */
+			if ( tmp == (block_nr - 1) ) {
+				--block_nr;
+				opcode = TFTP_ACK;
+				continue;
+			}
 		}
 
 		if (cmd_put && (opcode == TFTP_ACK)) {




More information about the busybox-cvs mailing list