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
This commit is contained in:
Michael Tuexen 2020-12-10 19:36:33 +00:00
parent 97c8162543
commit 1f67c37c1f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368521

View File

@ -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;
}