From ffc7057ae40fa59981106a4fa1ae2f40c746a3b9 Mon Sep 17 00:00:00 2001 From: Chen Wu Date: Wed, 13 Jul 2022 11:48:04 +0800 Subject: [PATCH] lwip: Fixed that ipv6 dns cannot work --- components/esp_netif/lwip/esp_netif_lwip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/esp_netif/lwip/esp_netif_lwip.c b/components/esp_netif/lwip/esp_netif_lwip.c index 84807a385d..1ec9edf918 100644 --- a/components/esp_netif/lwip/esp_netif_lwip.c +++ b/components/esp_netif/lwip/esp_netif_lwip.c @@ -1479,7 +1479,9 @@ static esp_err_t esp_netif_set_dns_info_api(esp_netif_api_msg_t *msg) ip_addr_t *lwip_ip = (ip_addr_t*)&dns->ip; #if CONFIG_LWIP_IPV6 && LWIP_IPV4 - lwip_ip->type = IPADDR_TYPE_V4; + if (!IP_IS_V4(lwip_ip) && !IP_IS_V6(lwip_ip)) { + lwip_ip->type = IPADDR_TYPE_V4; + } #endif if (esp_netif->flags & ESP_NETIF_DHCP_SERVER) { #if ESP_DHCPS