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

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