Currently tftp code in the loader retransmits the previous packet if it receives any

unwanted packet(non-tftp). Change this to retransmit the packet(request or ack) only after
a timeout.

Obtained from:	Juniper Networks
Fixed by: Santhanakrishnan Balraj <sbalraj at juniper dot net>
This commit is contained in:
Craig Rodrigues 2011-06-15 22:08:18 +00:00
parent 6e4c6f18f7
commit dc438c8ec8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=223123

View file

@ -443,11 +443,15 @@ sendrecv_tftp(d, sproc, sbuf, ssize, rproc, rbuf, rsize)
continue;
}
recvnext:
/* Try to get a packet and process it. */
cc = (*rproc)(d, rbuf, rsize, tleft);
/* Return on data, EOF or real error. */
if (cc != -1 || errno != 0)
return (cc);
if ((getsecs() - t1) < tleft) {
goto recvnext;
}
/* Timed out or didn't get the packet we're waiting for */
tleft += MINTMO;