aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/tftp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index da44284dc..a1a79a09c 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -305,7 +305,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
305 } 305 }
306 306
307 307
308 if (finished) { 308 if (finished && (opcode == TFTP_ACK)) {
309 break; 309 break;
310 } 310 }
311 311
@@ -346,11 +346,10 @@ static inline int tftp(const int cmd, const struct hostent *host,
346 case 0: 346 case 0:
347 bb_error_msg("timeout"); 347 bb_error_msg("timeout");
348 348
349 timeout--;
349 if (timeout == 0) { 350 if (timeout == 0) {
350 len = -1; 351 len = -1;
351 bb_error_msg("last timeout"); 352 bb_error_msg("last timeout");
352 } else {
353 timeout--;
354 } 353 }
355 break; 354 break;
356 355