From 1d0272a600c7e64f641c3193eabd41f467c2d6ff Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Tue, 15 Dec 2020 09:43:18 +0000 Subject: When receiving a file having a length, which is a mulitple of the blocksize, close the file once it is received. Reported by: Timo Voelker MFC after: 1 week --- libexec/tftpd/tftp-transfer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libexec') diff --git a/libexec/tftpd/tftp-transfer.c b/libexec/tftpd/tftp-transfer.c index 2f3dc3fe05600..0a0c099e4c33e 100644 --- a/libexec/tftpd/tftp-transfer.c +++ b/libexec/tftpd/tftp-transfer.c @@ -397,9 +397,9 @@ tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts, send_error(peer, ENOSPACE); goto abort; } - if (n_data != segsize) - write_close(); } + if (n_data != segsize) + write_close(); windowblock++; /* Only send ACKs for the last block in the window. */ -- cgit v1.2.3