From b99aec0ba5b5b5f7f565c89bb0dab158d7342fee Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 30 Jul 2003 07:16:39 +0000 Subject: Christian Meyer provided this patch to fix more bugs with the tftp client --- networking/tftp.c | 5 ++--- 1 file 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, } - if (finished) { + if (finished && (opcode == TFTP_ACK)) { break; } @@ -346,11 +346,10 @@ static inline int tftp(const int cmd, const struct hostent *host, case 0: bb_error_msg("timeout"); + timeout--; if (timeout == 0) { len = -1; bb_error_msg("last timeout"); - } else { - timeout--; } break; -- cgit v1.2.3