svn commit: r368657 - head/libexec/tftpd

Michael Tuexen tuexen at FreeBSD.org
Tue Dec 15 09:43:19 UTC 2020


Author: tuexen
Date: Tue Dec 15 09:43:18 2020
New Revision: 368657
URL: https://svnweb.freebsd.org/changeset/base/368657

Log:
  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

Modified:
  head/libexec/tftpd/tftp-transfer.c

Modified: head/libexec/tftpd/tftp-transfer.c
==============================================================================
--- head/libexec/tftpd/tftp-transfer.c	Tue Dec 15 08:29:45 2020	(r368656)
+++ head/libexec/tftpd/tftp-transfer.c	Tue Dec 15 09:43:18 2020	(r368657)
@@ -397,9 +397,9 @@ tftp_receive(int peer, uint16_t *block, struct tftp_st
 					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. */


More information about the svn-src-head mailing list