diff options
author | H. Peter Anvin <hpa@zytor.com> | 2011-05-09 21:09:18 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2011-05-09 21:09:18 -0700 |
commit | 05ffcecaa8bbaedc81b42ea240f34f2ad0b5f126 (patch) | |
tree | 757a01782742a7f0991c8f19597b4b3eb14d003a | |
parent | ad5aab9281b6d67b77537b4aabfe5bc070e7fe99 (diff) | |
parent | 915f62f5c76d7bd953b758d477b542acf6a3bf65 (diff) | |
download | tftp-hpa-05ffcecaa8bbaedc81b42ea240f34f2ad0b5f126.tar.gz |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | tftpd/recvfrom.c | 3 | ||||
-rw-r--r-- | tftpd/tftpd.c | 4 |
3 files changed, 9 insertions, 1 deletions
@@ -6,6 +6,9 @@ Changes in 5.1: Build fixes. + Fix handling of block number wraparound after a successful + options negotiation. + Changes in 5.0: Try to on platforms with getaddrinfo() without AI_ADDRCONFIG or diff --git a/tftpd/recvfrom.c b/tftpd/recvfrom.c index 389ba82..3ee5642 100644 --- a/tftpd/recvfrom.c +++ b/tftpd/recvfrom.c @@ -245,7 +245,8 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags, int myrecvfrom(int s, void *buf, int len, unsigned int flags, - struct sockaddr *from, int *fromlen, union sock_addr *myaddr) + struct sockaddr *from, socklen_t * fromlen, + union sock_addr *myaddr) { /* There is no way we can get the local address, fudge it */ diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index 1f946f6..c122d61 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -1648,6 +1648,10 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac ap->th_opcode = htons((u_short) ACK); ap->th_block = htons((u_short) block); acksize = 4; + /* If we're sending a regular ACK, that means we have successfully + * sent the OACK. Clear oap so that we won't try to send another + * OACK when the block number wraps back to 0. */ + oap = NULL; } if (!++block) block = rollover_val; |