aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-06-07 02:40:39 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-06-07 02:40:39 +0000
commit219c31556c1239d4da9a33f9fd23d323bff42cda (patch)
treef12f8a0c90838f21d42e87a64e66f2de144c5025
parentd412110b2e9e15ed7ff9437e776986d472508b9b (diff)
downloadbusybox-w32-219c31556c1239d4da9a33f9fd23d323bff42cda.tar.gz
busybox-w32-219c31556c1239d4da9a33f9fd23d323bff42cda.tar.bz2
busybox-w32-219c31556c1239d4da9a33f9fd23d323bff42cda.zip
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 git-svn-id: svn://busybox.net/trunk/busybox@10477 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/tftp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index 095dc58f9..334d03b6a 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -458,6 +458,12 @@ static inline int tftp(const int cmd, const struct hostent *host,
458 opcode = TFTP_ACK; 458 opcode = TFTP_ACK;
459 continue; 459 continue;
460 } 460 }
461 /* in case the last ack disappeared into the ether */
462 if ( tmp == (block_nr - 1) ) {
463 --block_nr;
464 opcode = TFTP_ACK;
465 continue;
466 }
461 } 467 }
462 468
463 if (cmd_put && (opcode == TFTP_ACK)) { 469 if (cmd_put && (opcode == TFTP_ACK)) {