mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 00:15:16 +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;
|
||||
}
|
||||
|
||||
#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) ||
|
||||
|
Loading…
Reference in New Issue
Block a user