diff --git a/src/api/api_msg.c b/src/api/api_msg.c index d497ed5c..8b92549d 100644 --- a/src/api/api_msg.c +++ b/src/api/api_msg.c @@ -1587,7 +1587,7 @@ lwip_netconn_do_dns_found(const char *name, ip_addr_t *ipaddr, void *arg) { struct dns_api_msg *msg = (struct dns_api_msg*)arg; - LWIP_ASSERT("DNS response for wrong host name", strcmp(msg->name, name) == 0); + /* we trust the internal implementation to be correct :-) */ LWIP_UNUSED_ARG(name); if (ipaddr == NULL) { diff --git a/src/api/netdb.c b/src/api/netdb.c index 3545af39..ad939445 100644 --- a/src/api/netdb.c +++ b/src/api/netdb.c @@ -278,6 +278,12 @@ lwip_getaddrinfo(const char *nodename, const char *servname, return EAI_NONAME; } + if (hints != NULL) { + if ((hints->ai_family != AF_UNSPEC) && (hints->ai_family != AF_INET)) { + return EAI_FAMILY; + } + } + if (servname != NULL) { /* service name specified: convert to port number * @todo?: currently, only ASCII integers (port numbers) are supported! */ diff --git a/src/include/lwip/netdb.h b/src/include/lwip/netdb.h index 0a57dd4c..3abd295b 100644 --- a/src/include/lwip/netdb.h +++ b/src/include/lwip/netdb.h @@ -61,6 +61,7 @@ extern "C" { #define EAI_SERVICE 201 #define EAI_FAIL 202 #define EAI_MEMORY 203 +#define EAI_FAMILY 204 #define HOST_NOT_FOUND 210 #define NO_DATA 211