[wireguard] Implement workaround for crash on IDF 5+ (#6846)

This commit is contained in:
Keith Burzinski 2024-06-03 22:10:44 -05:00 committed by GitHub
parent cdf83c5d8c
commit 2d56d8d84f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,10 @@ from esphome.const import (
CONF_TIME_ID,
CONF_ADDRESS,
CONF_REBOOT_TIMEOUT,
KEY_CORE,
KEY_FRAMEWORK_VERSION,
)
from esphome.components.esp32 import CORE, add_idf_sdkconfig_option
from esphome.components import time
from esphome.core import TimePeriod
from esphome import automation
@ -117,6 +120,13 @@ async def to_code(config):
if config[CONF_REQUIRE_CONNECTION_TO_PROCEED]:
cg.add(var.disable_auto_proceed())
# Workaround for crash on IDF 5+
# See https://github.com/trombik/esp_wireguard/issues/33#issuecomment-1568503651
if CORE.using_esp_idf and CORE.data[KEY_CORE][KEY_FRAMEWORK_VERSION] >= cv.Version(
5, 0, 0
):
add_idf_sdkconfig_option("CONFIG_LWIP_PPP_SUPPORT", True)
# This flag is added here because the esp_wireguard library statically
# set the size of its allowed_ips list at compile time using this value;
# the '+1' modifier is relative to the device's own address that will