diff options
-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 | ||