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: tftp fix for eCos applications


On Thu, 2003-03-13 at 01:49, Andrew Lunn wrote:
> On Wed, Mar 12, 2003 at 05:17:49PM -0800, Barton Meeks wrote:
> > Looks like I found and fixed something that had
> > already been fixed for redboot. When I tried to tftp
> > from my application, it only worked with 2 out of 4
> > tftp servers that I tried. One of the programs
> > produced this (winsock?) error: "RecvFrom returns
> > 10040", and described this as a datagram that was
> > larger than the buffer reserved for it. I traced this
> > to the initial tftp request message, which was much
> > larger coming from my application than a similar
> > request from linux tftp.
> 
> The standard does not say anything about maximum size's for the
> request. In fact the request is the same size as the data packets. So
> it could be argued that your server is broken. Having said that, your
> fix is reasonable. Note the servers will still break if somebody
> passes a very long filename.
> 
> I don't have any hardware to test with at the moment. If Gary does not
> beat me too it, i will test this tonight and commit it tomorrow.
> 

Well, if you trust the comment I put into the RedBoot code:

    // Send request - note: RFC 1350 (TFTP rev 2) indicates that this should be
    // only as long as required to hold the request, with the nul terminator.
    // Some servers silently go to lunch if the request is not the correct size.

then this would definitely be a correct patch and should be fine.

-- 
------------------------------------------------------------
Gary Thomas                 |
MLB Associates              |  Consulting for the
+1 (970) 229-1963           |    Embedded world
http://www.mlbassoc.com/    |
email: <gary at mlbassoc dot com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


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