mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-26 08:02:51 +00:00
Fix dns_getserver to return a pointer, not a value
This commit is contained in:
parent
606b6990ff
commit
5e7b343d52
@ -432,13 +432,13 @@ dns_setserver(u8_t numdns, const ip_addr_t *dnsserver)
|
||||
* @return IP address of the indexed DNS server or "ip_addr_any" if the DNS
|
||||
* server has not been configured.
|
||||
*/
|
||||
ip_addr_t
|
||||
const ip_addr_t*
|
||||
dns_getserver(u8_t numdns)
|
||||
{
|
||||
if (numdns < DNS_MAX_SERVERS) {
|
||||
return dns_servers[numdns];
|
||||
return &dns_servers[numdns];
|
||||
} else {
|
||||
return *IP_ADDR_ANY;
|
||||
return IP_ADDR_ANY;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, vo
|
||||
void dns_init(void);
|
||||
void dns_tmr(void);
|
||||
void dns_setserver(u8_t numdns, const ip_addr_t *dnsserver);
|
||||
ip_addr_t dns_getserver(u8_t numdns);
|
||||
const ip_addr_t* dns_getserver(u8_t numdns);
|
||||
err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr,
|
||||
dns_found_callback found, void *callback_arg);
|
||||
err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr,
|
||||
|
Loading…
Reference in New Issue
Block a user