diff options
author | Paul Fox <pgf@brightstareng.com> | 2005-07-20 19:49:15 +0000 |
---|---|---|
committer | Paul Fox <pgf@brightstareng.com> | 2005-07-20 19:49:15 +0000 |
commit | 1d4c88c8a5d2c8ffed5555c79d2c654f1287ddd8 (patch) | |
tree | 05631f7da48a284204ff88918fece737f6221b8e /networking/tftp.c | |
parent | 4905434b8aead249d6bdd134d2fbd8c06dfcc059 (diff) | |
download | busybox-w32-1d4c88c8a5d2c8ffed5555c79d2c654f1287ddd8.tar.gz busybox-w32-1d4c88c8a5d2c8ffed5555c79d2c654f1287ddd8.tar.bz2 busybox-w32-1d4c88c8a5d2c8ffed5555c79d2c654f1287ddd8.zip |
applying fix for:
0000271: [PATCH] tftp -g fails if a TFTP_ACK is lost
Diffstat (limited to 'networking/tftp.c')
-rw-r--r-- | networking/tftp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index 334d03b6a..9b9747785 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -320,7 +320,7 @@ static inline int tftp(const int cmd, const struct hostent *host, | |||
320 | FD_ZERO(&rfds); | 320 | FD_ZERO(&rfds); |
321 | FD_SET(socketfd, &rfds); | 321 | FD_SET(socketfd, &rfds); |
322 | 322 | ||
323 | switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) { | 323 | switch (select(socketfd + 1, &rfds, NULL, NULL, &tv)) { |
324 | case 1: | 324 | case 1: |
325 | len = recvfrom(socketfd, buf, tftp_bufsize, 0, | 325 | len = recvfrom(socketfd, buf, tftp_bufsize, 0, |
326 | (struct sockaddr *) &from, &fromlen); | 326 | (struct sockaddr *) &from, &fromlen); |
@@ -463,6 +463,11 @@ static inline int tftp(const int cmd, const struct hostent *host, | |||
463 | --block_nr; | 463 | --block_nr; |
464 | opcode = TFTP_ACK; | 464 | opcode = TFTP_ACK; |
465 | continue; | 465 | continue; |
466 | } else if (tmp + 1 == block_nr) { | ||
467 | /* Server lost our TFTP_ACK. Resend it */ | ||
468 | block_nr = tmp; | ||
469 | opcode = TFTP_ACK; | ||
470 | continue; | ||
466 | } | 471 | } |
467 | } | 472 | } |
468 | 473 | ||