This is the mail archive of the ecos-discuss@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: functions tftp_get & tftp_put broken ????


On Fri, Jun 20, 2003 at 09:55:24AM -0400, HG wrote:
> Hi Andrew,
> 
> 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. 

You said in your original email that inet_ntop was failing and
returning NULL. Please could you debug this further. 

Looking at the code if can fail in a few ways:

1) You pass it an address family that is not known: 

   This is impossible, since we pass in AF_INET and that part of the
   switch statement is not conditionally compiled.

2) sprintf is used to print the address to a tempory buffer. If the
   number of characters written is bigger than the size of the buffer
   passed in, it will return a NULL. This also seems unlikely since i
   pass a buffer of 20 bytes and an IPv4 address needs only 16 bytes.

3) Theoretically, if you pass a NULL pointer in as the destination
   string, inet_ntop will pass it out again as the result. Again this
   should not be possible since im not that stupid!

So something strange is going on here. Please can you single step the
code and find out where it fails.

     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


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