From 9e2f15ae51e8c3456f0b67bb8951e6c704395772 Mon Sep 17 00:00:00 2001 From: yuanjm Date: Mon, 6 Sep 2021 15:40:58 +0800 Subject: [PATCH] lwip: Support DHCP option length configuration --- components/lwip/Kconfig | 9 +++++++++ components/lwip/port/esp32/include/lwipopts.h | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index 4842182077..dae592cafb 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -266,6 +266,15 @@ menu "LWIP" server. Last valid DHCP configuration is stored in nvs and restored after reset/power-up. If IP is still available, there is no need for sending discovery message to DHCP server and save some time. + config LWIP_DHCP_OPTIONS_LEN + int "DHCP total option length" + default 68 + range 68 255 + help + Set total length of outgoing DHCP option msg. Generally bigger value means it can carry more + options and values. If your code meets LWIP_ASSERT due to option value is too long. + Please increase the LWIP_DHCP_OPTIONS_LEN value. + menu "DHCP server" config LWIP_DHCPS diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index 4bc2ad1396..b9cfe17aca 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -266,6 +266,12 @@ #endif +/** + * CONFIG_LWIP_DHCP_OPTIONS_LEN: The total length of outgoing DHCP option msg. If you have many options + * and options value is too long, you can configure the length according to your requirements + */ +#define DHCP_OPTIONS_LEN CONFIG_LWIP_DHCP_OPTIONS_LEN + /* ------------------------------------ ---------- AUTOIP options ----------