浏览代码

Merge branch 'feature/support_dhcp_option_len_configure' into 'master'

lw-ip: Support DHCP option length configuration

See merge request espressif/esp-idf!15085
Jiang Jiang Jian 4 年之前
父节点
当前提交
7da847ffea
共有 2 个文件被更改,包括 15 次插入0 次删除
  1. 9 0
      components/lwip/Kconfig
  2. 6 0
      components/lwip/port/esp32/include/lwipopts.h

+ 9 - 0
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
             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.
             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"
     menu "DHCP server"
 
 
         config LWIP_DHCPS
         config LWIP_DHCPS

+ 6 - 0
components/lwip/port/esp32/include/lwipopts.h

@@ -266,6 +266,12 @@
 
 
 #endif
 #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 ----------
    ---------- AUTOIP options ----------