diff --git a/src/core/memp.c b/src/core/memp.c index edbb982f..15852439 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -58,6 +58,7 @@ #include "lwip/snmp_structs.h" #include "lwip/snmp_msg.h" #include "lwip/dns.h" +#include "lwip/netdb.h" #include "netif/ppp/ppp.h" #include "netif/ppp/pppoe.h" #include "netif/ppp/pppol2tp.h" diff --git a/src/include/lwip/dns.h b/src/include/lwip/dns.h index e5530ef5..eb81c90a 100644 --- a/src/include/lwip/dns.h +++ b/src/include/lwip/dns.h @@ -70,13 +70,6 @@ extern "C" { #define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */ #define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */ -/* The size used for the next line is rather a hack, but it prevents including socket.h in all files - that include memp.h, and that would possibly break portability (since socket.h defines some types - and constants possibly already define by the OS). - Calculation rule: - sizeof(struct addrinfo) + sizeof(struct sockaddr_in) + DNS_MAX_NAME_LENGTH + 1 byte zero-termination */ -#define NETDB_ELEM_SIZE (32 + 16 + DNS_MAX_NAME_LENGTH + 1) - #if DNS_LOCAL_HOSTLIST /** struct used for local host-list */ struct local_hostlist_entry { diff --git a/src/include/lwip/netdb.h b/src/include/lwip/netdb.h index c6039f7b..0a57dd4c 100644 --- a/src/include/lwip/netdb.h +++ b/src/include/lwip/netdb.h @@ -92,6 +92,8 @@ struct addrinfo { }; #endif /* LWIP_DNS_API_DECLARE_STRUCTS */ +#define NETDB_ELEM_SIZE (sizeof(struct addrinfo) + sizeof(struct sockaddr_in) + DNS_MAX_NAME_LENGTH + 1) + #if LWIP_DNS_API_DECLARE_H_ERRNO /* application accessable error code set by the DNS API functions */ extern int h_errno;