fix(esp_netif): Restore DNS servers per netif when setting it default(5.2)

Introducing config option `CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF`
to overcome LWIP limitation of using global DNS server info.
This config option enables LWIP callbacks to collect per netif DNS
server info and then restores global DNS servers of whichever network
interface is selected as default.

LWIP submodule update v5.2: git log --oneline f1746813..3a3d1fb3
  - dns: Allow storing dnsserver per netif (espressif/esp-lwip@3a3d1fb3)
  - api_msg: Fix unused local variable if LWIP_NETCONN_SEM_PER_THREAD=1
    (espressif/esp-lwip@aa4f6e78)
  - lwip: fix gcc -fanalyzer warnings (espressif/esp-lwip@4297782b)
This commit is contained in:
David Cermak
2024-05-21 16:57:06 +02:00
parent bde21acfb6
commit 7931ac6f19
8 changed files with 131 additions and 30 deletions

View File

@@ -503,6 +503,17 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min)
#define LWIP_DNS_SUPPORT_MDNS_QUERIES 0
#endif
/**
* LWIP_DNS_SETSERVER_WITH_NETIF: If this is turned on, the dns_setserver_with_netif() is enabled and called
* from all internal modules (instead of dns_setserver()) allowing to setup a user callback to collect DNS server
* information acquired by the related network interface.
*/
#ifdef CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF
#define LWIP_DNS_SETSERVER_WITH_NETIF 1
#else
#define LWIP_DNS_SETSERVER_WITH_NETIF 0
#endif
/*
---------------------------------
---------- UDP options ----------