diff options
author | pgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-20 19:49:15 +0000 |
---|---|---|
committer | pgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-20 19:49:15 +0000 |
commit | 0ebaa7eb765859d2a6d929b134e39e0866c55d6b (patch) | |
tree | 05631f7da48a284204ff88918fece737f6221b8e | |
parent | f58ceacd59c45673be0bb3675bbab4e09164bc61 (diff) | |
download | busybox-w32-0ebaa7eb765859d2a6d929b134e39e0866c55d6b.tar.gz busybox-w32-0ebaa7eb765859d2a6d929b134e39e0866c55d6b.tar.bz2 busybox-w32-0ebaa7eb765859d2a6d929b134e39e0866c55d6b.zip |
applying fix for:
0000271: [PATCH] tftp -g fails if a TFTP_ACK is lost
git-svn-id: svn://busybox.net/trunk/busybox@10885 69ca8d6d-28ef-0310-b511-8ec308f3f277
-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 | ||