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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to