feat(lwip): add fall back dns config in menuconfig

This commit is contained in:
xueyunfei
2024-02-21 19:07:01 +08:00
committed by zhangyanjiao
parent 4a3f224fe1
commit aa21e87cd9
3 changed files with 45 additions and 6 deletions
+11 -2
View File
@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*
* SPDX-FileContributor: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2015-2024 Espressif Systems (Shanghai) CO LTD
*/
#ifndef LWIP_HDR_ESP_LWIPOPTS_H
#define LWIP_HDR_ESP_LWIPOPTS_H
@@ -472,7 +472,7 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min)
/** The maximum of DNS servers
*/
#define DNS_MAX_SERVERS 3
#define DNS_MAX_SERVERS CONFIG_LWIP_DNS_MAX_SERVERS
/** ESP specific option only applicable if ESP_DNS=1
*
@@ -481,6 +481,14 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min)
*/
#define DNS_FALLBACK_SERVER_INDEX (DNS_MAX_SERVERS - 1)
#ifdef CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT
#define FALLBACK_DNS_SERVER_ADDRESS(address) \
do { ip_addr_t *server_dns = address; \
char server_ip[] = CONFIG_LWIP_FALLBACK_DNS_SERVER_ADDRESS; \
ipaddr_aton(server_ip, server_dns); \
} while (0)
#endif /* CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT */
/**
* LWIP_DNS_SUPPORT_MDNS_QUERIES==1: Enable mDNS queries in hostname resolution.
* This option is set via menuconfig.
@@ -1576,6 +1584,7 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min)
#define ESP_LWIP_LOCK 1
#define ESP_THREAD_PROTECTION 1
#define LWIP_SUPPORT_CUSTOM_PBUF 1
#define ESP_LWIP_FALLBACK_DNS_PREFER_IPV4 0
/*
-----------------------------------------