Skip to content

Commit e5b5196

Browse files
committed
Merge branch 'bugfix/set_ipv6_dns_error' into 'master'
fix(tcpip_adapter): Fixed that IPv6 DNS can not work See merge request sdk/ESP8266_RTOS_SDK!1690
2 parents 816bf9b + 045b4c9 commit e5b5196

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/tcpip_adapter/tcpip_adapter_lwip.c

+6
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,14 @@ esp_err_t tcpip_adapter_set_dns_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_
825825
return ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS;
826826
}
827827

828+
#if CONFIG_LWIP_IPV6
829+
if (!IP_IS_V4(&dns->ip) && !IP_IS_V6(&dns->ip)) {
830+
IP_SET_TYPE_VAL(dns->ip, IPADDR_TYPE_V4);
831+
}
832+
#else
828833
ESP_LOGD(TAG, "set dns if=%d type=%d dns=%x", tcpip_if, type, ip_2_ip4(&(dns->ip))->addr);
829834
IP_SET_TYPE_VAL(dns->ip, IPADDR_TYPE_V4);
835+
#endif
830836

831837
if (tcpip_if == TCPIP_ADAPTER_IF_STA || tcpip_if == TCPIP_ADAPTER_IF_ETH) {
832838
dns_setserver(type, &(dns->ip));

0 commit comments

Comments
 (0)