From c3f7107e2bac845343b0683c545c0f9fb11691dc Mon Sep 17 00:00:00 2001 From: goldsimon Date: Thu, 23 Apr 2009 16:54:30 +0000 Subject: [PATCH] Fixed some issues with DNS_LOCAL_HOSTLIST --- src/core/dns.c | 6 +++--- src/core/init.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/dns.c b/src/core/dns.c index 88897f87..b562d259 100644 --- a/src/core/dns.c +++ b/src/core/dns.c @@ -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 */ @@ -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; } @@ -474,7 +474,7 @@ dns_lookup(const char *name) } } - return 0; + return INADDR_NONE; } #if DNS_DOES_NAME_CHECK diff --git a/src/core/init.c b/src/core/init.c index e99cc4c9..37fe7f12 100644 --- a/src/core/init.c +++ b/src/core/init.c @@ -161,7 +161,7 @@ #if (TCP_QUEUE_OOSEQ && !LWIP_TCP) #error "TCP_QUEUE_OOSEQ requires LWIP_TCP" #endif -#if (DNS_LOCAL_HOSTLIST && !(defined(DNS_LOCAL_HOSTLIST_INIT))) +#if (DNS_LOCAL_HOSTLIST && !DNS_LOCAL_HOSTLIST_IS_DYNAMIC && !(defined(DNS_LOCAL_HOSTLIST_INIT))) #error "you have to define define DNS_LOCAL_HOSTLIST_INIT {{'host1', 0x123}, {'host2', 0x234}} to initialize DNS_LOCAL_HOSTLIST" #endif