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
|
* @return IP address of the indexed DNS server or "ip_addr_any" if the DNS
|
||||||
* server has not been configured.
|
* server has not been configured.
|
||||||
*/
|
*/
|
||||||
ip_addr_t
|
const ip_addr_t*
|
||||||
dns_getserver(u8_t numdns)
|
dns_getserver(u8_t numdns)
|
||||||
{
|
{
|
||||||
if (numdns < DNS_MAX_SERVERS) {
|
if (numdns < DNS_MAX_SERVERS) {
|
||||||
return dns_servers[numdns];
|
return &dns_servers[numdns];
|
||||||
} else {
|
} else {
|
||||||
return *IP_ADDR_ANY;
|
return IP_ADDR_ANY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,15 +93,15 @@ struct local_hostlist_entry {
|
|||||||
*/
|
*/
|
||||||
typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, void *callback_arg);
|
typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, void *callback_arg);
|
||||||
|
|
||||||
void dns_init(void);
|
void dns_init(void);
|
||||||
void dns_tmr(void);
|
void dns_tmr(void);
|
||||||
void dns_setserver(u8_t numdns, const ip_addr_t *dnsserver);
|
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,
|
err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr,
|
||||||
dns_found_callback found, void *callback_arg);
|
dns_found_callback found, void *callback_arg);
|
||||||
err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr,
|
err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr,
|
||||||
dns_found_callback found, void *callback_arg,
|
dns_found_callback found, void *callback_arg,
|
||||||
u8_t dns_addrtype);
|
u8_t dns_addrtype);
|
||||||
|
|
||||||
|
|
||||||
#if DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
|
#if DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
|
||||||
|
Loading…
Reference in New Issue
Block a user