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

pgf at busybox.net pgf at busybox.net
Wed Jul 20 19:49:15 UTC 2005


Author: pgf
Date: 2005-07-20 13:49:15 -0600 (Wed, 20 Jul 2005)
New Revision: 10885

Log:
applying fix for:
    0000271: [PATCH] tftp -g fails if a TFTP_ACK is lost



Modified:
   trunk/busybox/networking/tftp.c


Changeset:
Modified: trunk/busybox/networking/tftp.c
===================================================================
--- trunk/busybox/networking/tftp.c	2005-07-20 19:46:32 UTC (rev 10884)
+++ trunk/busybox/networking/tftp.c	2005-07-20 19:49:15 UTC (rev 10885)
@@ -320,7 +320,7 @@
 			FD_ZERO(&rfds);
 			FD_SET(socketfd, &rfds);
 
-			switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) {
+			switch (select(socketfd + 1, &rfds, NULL, NULL, &tv)) {
 			case 1:
 				len = recvfrom(socketfd, buf, tftp_bufsize, 0,
 						(struct sockaddr *) &from, &fromlen);
@@ -463,6 +463,11 @@
 				--block_nr;
 				opcode = TFTP_ACK;
 				continue;
+			} else if (tmp + 1 == block_nr) {
+				/* Server lost our TFTP_ACK.  Resend it */
+				block_nr = tmp;
+				opcode = TFTP_ACK;
+				continue;
 			}
 		}
 




More information about the busybox-cvs mailing list