diff --git a/stand/libsa/tftp.c b/stand/libsa/tftp.c --- a/stand/libsa/tftp.c +++ b/stand/libsa/tftp.c @@ -114,6 +114,8 @@ unsigned long tftp_tsize; void *pkt; struct tftphdr *tftp_hdr; + char *tftp_cache; + bool lastacksent; }; struct tftprecv_extra { @@ -378,6 +380,7 @@ if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ tftp_sendack(h, h->currblock); + h->lastacksent = true; } return (0); } @@ -594,7 +597,8 @@ struct tftp_handle *tftpfile; tftpfile = f->f_fsdata; - /* let it time out ... */ + if (tftpfile->lastacksent == false) + tftp_senderr(tftpfile, 0, "No error: file closed"); if (tftpfile) { free(tftpfile->path);