lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [task #7507] Add static host table to dns_gethostbyname


From: Frédéric Bernon
Subject: [lwip-devel] [task #7507] Add static host table to dns_gethostbyname
Date: Thu, 23 Apr 2009 16:17:48 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9 (.NET CLR 3.5.30729)

Update of task #7507 (project lwip):

             Open/Closed:                  Closed => Open                   

    _______________________________________________________

Follow-up Comment #2:

Some breaks in the last dns.c changes (win32 port doesn't build):

Index: dns.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/dns.c,v
retrieving revision 1.24
diff -u -3 -p -r1.24 dns.c
--- dns.c       21 Apr 2009 18:35:18 -0000      1.24
+++ dns.c       23 Apr 2009 15:50:46 -0000
@@ -193,7 +193,7 @@ struct dns_table_entry {
   void *arg;
 };
 
-#ifdef DNS_LOCAL_HOSTLIST
+#if DNS_LOCAL_HOSTLIST
 /** struct used for local host-list */
 struct local_hostlist_entry {
   /** static hostname */
@@ -319,7 +319,7 @@ dns_tmr(void)
 static void
 dns_init_local()
 {
-#ifdef DNS_LOCAL_HOSTLIST_INIT
+#if DNS_LOCAL_HOSTLIST_INIT
   int i;
   struct local_hostlist_entry *entry;
 #if DNS_LOCAL_HOSTLIST_IS_DYNAMIC


There is also a warning if DNS_LOCAL_HOSTLIST==0


@@ -455,9 +455,9 @@ static u32_t
 dns_lookup(const char *name)
 {
   u8_t i;
+#if DNS_LOCAL_HOSTLIST
   u32_t addr;
 
-#if DNS_LOCAL_HOSTLIST
   if ((addr = dns_lookup_static(name)) != INADDR_NONE) {
     return addr;
   }

Last, in dns_gethostbyname, :

"((addr->addr = dns_lookup(hostname)) != 0)"

is replaced by 

"((addr->addr = dns_lookup(hostname)) != INADDR_NONE)"

It doesn't work when you call "dns_gethostbyname("www.3com.com"...)" because
dns_lookup return 0 when no found in cache, so, dns_gethostbyname returns
ERR_OK.

I also see that "inet_addr("3com.com") returns now 0.0.0.3,  I note that on
patch#6765 (but I'm not sure the problem is recent).







    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?7507>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]