mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-13 10:15:43 +00:00
Fix return value of sntp_getserver() call to return a pointer
This commit is contained in:
parent
8e7b8a32f9
commit
ac0af0d7c7
@ -670,13 +670,13 @@ dhcp_set_ntp_servers(u8_t num, const ip4_addr_t *server)
|
|||||||
* @return IP address of the indexed NTP server or "ip_addr_any" if the NTP
|
* @return IP address of the indexed NTP server or "ip_addr_any" if the NTP
|
||||||
* server has not been configured by address (or at all).
|
* server has not been configured by address (or at all).
|
||||||
*/
|
*/
|
||||||
ip_addr_t
|
const ip_addr_t*
|
||||||
sntp_getserver(u8_t idx)
|
sntp_getserver(u8_t idx)
|
||||||
{
|
{
|
||||||
if (idx < SNTP_MAX_SERVERS) {
|
if (idx < SNTP_MAX_SERVERS) {
|
||||||
return sntp_servers[idx].addr;
|
return &sntp_servers[idx].addr;
|
||||||
}
|
}
|
||||||
return *IP_ADDR_ANY;
|
return IP_ADDR_ANY;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SNTP_SERVER_DNS
|
#if SNTP_SERVER_DNS
|
||||||
|
@ -51,7 +51,7 @@ void sntp_stop(void);
|
|||||||
u8_t sntp_enabled(void);
|
u8_t sntp_enabled(void);
|
||||||
|
|
||||||
void sntp_setserver(u8_t idx, const ip_addr_t *addr);
|
void sntp_setserver(u8_t idx, const ip_addr_t *addr);
|
||||||
ip_addr_t sntp_getserver(u8_t idx);
|
const ip_addr_t* sntp_getserver(u8_t idx);
|
||||||
|
|
||||||
#if SNTP_SERVER_DNS
|
#if SNTP_SERVER_DNS
|
||||||
void sntp_setservername(u8_t idx, char *server);
|
void sntp_setservername(u8_t idx, char *server);
|
||||||
|
Loading…
Reference in New Issue
Block a user