This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for tftp client code


On Fri, Oct 10, 2003 at 11:33:43AM +0200, Eric Doenges wrote:
> Andrew Lunn wrote:
> >
> >Thinking about this some more, i don't see how the scenario you have
> >fixed could actually happen. tftp sends a data packet and expects an
> >ACK. It should not send the next data packet in sequence until it
> >receives the ACK for the previous packet. 
> 
> It doesn't. It repeats the data packet. In all cases that I observed.
> the count in the header corresponded to the count of the last packet
> received. In this case, the original code does not copy the data (which
> is correct), acknowledges the DATA received by sending an ACK for the
> last valid packet received (which I think is also correct), and does
> not set actual_len to the length of the DATA packet just received. This
> means that actual_len will be zero whenever a packet is received with
> the wrong sequence count. Next, the code checks if actual_len is
> greater or equal to zero and smaller than the segment size of 512 bytes,
> in which case the TFTP protocoll assumes the transmission is complete.

Now i fully understand. I misunderstood what you said the first time.
I tweaked the comments a little just to make it clearer for future
readers of the code.

        Thanks
                Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]