Date: Wed, 15 Jun 2011 22:08:18 +0000 (UTC) From: Craig Rodrigues <rodrigc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r223123 - head/lib/libstand Message-ID: <201106152208.p5FM8IcR000302@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rodrigc Date: Wed Jun 15 22:08:18 2011 New Revision: 223123 URL: http://svn.freebsd.org/changeset/base/223123 Log: 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> Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Jun 15 22:04:14 2011 (r223122) +++ head/lib/libstand/tftp.c Wed Jun 15 22:08:18 2011 (r223123) @@ -443,11 +443,15 @@ sendrecv_tftp(d, sproc, sbuf, ssize, rpr 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106152208.p5FM8IcR000302>