1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-18 15:55:46 +00:00

Disable IPv6 when config explicitly says false (#5310)

This commit is contained in:
Jimmy Hedman
2023-09-05 09:56:17 +02:00
committed by GitHub
parent 32b24726ed
commit 97dcbe84da
4 changed files with 22 additions and 21 deletions

View File

@@ -447,9 +447,9 @@ void WiFiComponent::wifi_event_callback_(esphome_wifi_event_id_t event, esphome_
buf[it.ssid_len] = '\0';
ESP_LOGV(TAG, "Event: Connected ssid='%s' bssid=" LOG_SECRET("%s") " channel=%u, authmode=%s", buf,
format_mac_addr(it.bssid).c_str(), it.channel, get_auth_mode_str(it.authmode));
#if LWIP_IPV6
#if ENABLE_IPV6
this->set_timeout(100, [] { WiFi.enableIpV6(); });
#endif /* LWIP_IPV6 */
#endif /* ENABLE_IPV6 */
break;
}
@@ -504,13 +504,13 @@ void WiFiComponent::wifi_event_callback_(esphome_wifi_event_id_t event, esphome_
s_sta_connecting = false;
break;
}
#if LWIP_IPV6
#if ENABLE_IPV6
case ESPHOME_EVENT_ID_WIFI_STA_GOT_IP6: {
auto it = info.got_ip6.ip6_info;
ESP_LOGV(TAG, "Got IPv6 address=" IPV6STR, IPV62STR(it.ip));
break;
}
#endif /* LWIP_IPV6 */
#endif /* ENABLE_IPV6 */
case ESPHOME_EVENT_ID_WIFI_STA_LOST_IP: {
ESP_LOGV(TAG, "Event: Lost IP");
break;