process "localhost" name in dns_gethostbyname

This commit is contained in:
fbernon 2007-12-02 17:15:28 +00:00
parent 47d8d69b81
commit dde6ddfd7c

View File

@ -803,6 +803,13 @@ DNS_RESULT dns_gethostbyname(const char *hostname, struct ip_addr *addr, dns_fou
return DNS_QUERY_INVALID;
}
#if LWIP_HAVE_LOOPIF
if (strcmp(hostname,"localhost")==0) {
addr->addr = INADDR_LOOPBACK;
return DNS_COMPLETE;
}
#endif /* LWIP_HAVE_LOOPIF */
/* host name already in octet notation? set ip addr and return COMPLETE
* already have this address cached? */
if (((addr->addr = inet_addr(hostname)) != INADDR_NONE) ||