This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: functions tftp_get & tftp_put broken ????
Hi all,
> So something strange is going on here. Please can you single step the
> code and find out where it fails.
you where right , setting breakpoints with gdb showed that it was the
function sendto that was returning -1 in the tftp_client_get function
of tftp_client.c (after the comment // Send request)
comparing the parameters passed with the previous library build
and the more recent one the following parameter passed to this function
is different : addrinfo->ai_addrlen
the value that produced a correct result is 16 and the one produced
with the recent library is 32 .
this parameter is derived earlier in the code from
error = getaddrinfo(server, "tftp", &hints, &res);
a quick fix that temporarely repaired this problem is the following:
previous :
// Send request
if (sendto(s, data, (int)(cp-data), 0, .....
modified:
addrinfo->ai_addrlen = 16; //temporary experimental fix: not permanent
// Send request
if (sendto(s, data, (int)(cp-data), 0, .....
while this fixed the test case , the root of the problem appears to be
in getaddrinfo ? If I come up with a patch for this function that does not
break anything else i will post it in the patch mailing list.
thanks
Henri
> >
> > here is a simplified test case derived from the tftp_client_test.c in
> > net/common/tests . The redboot used is derived from the june 6 th
download.
> > The file hello.srec is 1043008 bytes, tftp server is SolarWinds tftp
server
> > on an Nt (previous tests with the may version of the library on linux
and
> > freebsd where ok). the redboot command fconfig sets up the tftp server
to
> > the NT's ip address. Redboot's ip address did not use bootp but a fixed
ip.
> > The freebsd config used the fixed ip option
> >
> > many thanks
> >
> > Henri
>
> It works for me.
...
>
> Thanks
> Andrew
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss