Thanks for your hint. I dug even deeper but still wasn't successful. At the end I was able to break in
do_dns_found(const char *name, struct ip_addr *ipaddr, void *arg) This method returns ERR_VAL (-8) which says "timeout or memory error" or "illegal value" or "dns server response was invalid" respectively (depending on different method comments). I guess that my name argument is OK. At least my debugger resolves the name pointer to "ntpbmt01.dyndns.org" which is the desired server. The second argument (addr) gets defined in netconn_gethostbyname(). I am only passing the name pointer to gethostbyname(). Could there anyway be a problem with the memory (e.g. a missing memory allocation / lwIP configuration setting)? Still there is no DNS packet output which I would expect to see after the call of dns_enqueue()... -----Ursprüngliche Nachricht----- Von: Pettinato, Jim [mailto:[email protected]] Gesendet: Freitag, 4. September 2009 17:27 An: [email protected]; Mailing list for lwIP users Betreff: RE: [lwip-users] DNS for socket API -8 (ERR_ARG) would appear to indicate that the netconn_gethostbyname() function is being passed either a NULL pointer for the name to look up, or a NULL pointer for the destination to write the resolved IP address. Check your arguments to the call; my guess would be perhaps you are a level of indirection off on your addr argument (i.e. passing the value instead of the address of your ip_addr variable). -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Mathias Zenger Sent: Friday, September 04, 2009 10:40 AM To: Mailing list for lwIP users Subject: AW: [lwip-users] DNS for socket API Hi, I am working on my 'problem' again. My call of gethostbyname() after a few seconds always returns NULL. I set a breakpoint within this function and saw that err = netconn_gethostbyname(name, &addr); returns the error code -8. Unfortunately I still don't know what I am doing wrong. DHCP works fine and gives the correct DNS server address. LWIP_DNS is set to 1. There is no packet output from my device to the DNS server at all (no packet captured with Wireshark). Is there a special need to 'somehow handle' the DNS server address? To solve my previous problems I replaced the netdb.c/h files in my stack. Afterwards the compiler errors/warnings disappeared. Was it a bad idea to just replace the two 1.3.0 files by the 1.3.1 version? Any other ideas? Thanks. Regards, Mathias -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]]im Auftrag von [email protected] Gesendet: Dienstag, 11. August 2009 16:41 An: Mailing list for lwIP users Betreff: Re: [lwip-users] DNS for socket API Simon Goldschmidt wrote: >> In netdb.c I get some warnings for implicit declarations of strlen(), >> memcpy() and memset(). This probably could indicate a missing >> string.h include. >> > That could well be as I think the example ports include string.h in > their port-defined cc.h file. Just try to add the missing include in netdb.c until we added it to CVS. > I've just added #include <string.h> to netdb.c in CVS. >> The error in netdb.c says 'conflicting types for lwip_gethostbyname_r'. In >> netdb.h I get the error messages 'previous declaration of >> lwip_gethostbyname_r was here' and 'expected declaration specifiers >> or '...' >> before size_t' >> > > That would mean another standard include is missing in netdb.h. I'll > check that. > #include <stddef.h> was added to netdb.h 2 weeks ago. Simon _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
