mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 09:19:53 +00:00
process "localhost" name in dns_gethostbyname
This commit is contained in:
parent
47d8d69b81
commit
dde6ddfd7c
@ -803,6 +803,13 @@ DNS_RESULT dns_gethostbyname(const char *hostname, struct ip_addr *addr, dns_fou
|
|||||||
return DNS_QUERY_INVALID;
|
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
|
/* host name already in octet notation? set ip addr and return COMPLETE
|
||||||
* already have this address cached? */
|
* already have this address cached? */
|
||||||
if (((addr->addr = inet_addr(hostname)) != INADDR_NONE) ||
|
if (((addr->addr = inet_addr(hostname)) != INADDR_NONE) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user