diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2020-12-10 19:36:33 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2020-12-10 19:36:33 +0000 |
commit | 1f67c37c1f9353e3a211795ff5e154884319a0cd (patch) | |
tree | 0bd0e356d04a3fcb038907f50a851cddf9b12c36 /libexec | |
parent | 97c8162543659f3de5fa13ef78476518ecbd1b2c (diff) | |
download | src-test2-1f67c37c1f9353e3a211795ff5e154884319a0cd.tar.gz src-test2-1f67c37c1f9353e3a211795ff5e154884319a0cd.zip |
Fix the TFTP client when performing a RRQ for files smaller than 512 bytes
and the server not sending an OACK:
* Close the file.
* Report the correct the number of received blocks.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=368521
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/tftpd/tftp-transfer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libexec/tftpd/tftp-transfer.c b/libexec/tftpd/tftp-transfer.c index 1d449ea09778..1f130b498e2e 100644 --- a/libexec/tftpd/tftp-transfer.c +++ b/libexec/tftpd/tftp-transfer.c @@ -280,6 +280,8 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts, } if (fb_size != segsize) { + ts->blocks++; + write_close(); gettimeofday(&(ts->tstop), NULL); return; } |