mirror of
https://github.com/sheumann/hush.git
synced 2025-01-04 22:34:37 +00:00
applying fix for:
0000271: [PATCH] tftp -g fails if a TFTP_ACK is lost
This commit is contained in:
parent
4905434b8a
commit
1d4c88c8a5
@ -320,7 +320,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
|
|||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_SET(socketfd, &rfds);
|
FD_SET(socketfd, &rfds);
|
||||||
|
|
||||||
switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) {
|
switch (select(socketfd + 1, &rfds, NULL, NULL, &tv)) {
|
||||||
case 1:
|
case 1:
|
||||||
len = recvfrom(socketfd, buf, tftp_bufsize, 0,
|
len = recvfrom(socketfd, buf, tftp_bufsize, 0,
|
||||||
(struct sockaddr *) &from, &fromlen);
|
(struct sockaddr *) &from, &fromlen);
|
||||||
@ -463,6 +463,11 @@ static inline int tftp(const int cmd, const struct hostent *host,
|
|||||||
--block_nr;
|
--block_nr;
|
||||||
opcode = TFTP_ACK;
|
opcode = TFTP_ACK;
|
||||||
continue;
|
continue;
|
||||||
|
} else if (tmp + 1 == block_nr) {
|
||||||
|
/* Server lost our TFTP_ACK. Resend it */
|
||||||
|
block_nr = tmp;
|
||||||
|
opcode = TFTP_ACK;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user