From 68ecc44d34230451053547c51b71d7b69a105e82 Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Thu, 30 Apr 2020 16:59:17 +0800 Subject: [PATCH] fix bug for ipv6 fragment --- components/lwip/Kconfig | 25 ++++++++++++++----- components/lwip/lwip | 2 +- components/lwip/port/esp32/include/lwipopts.h | 22 +++++++++++++--- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index a34a01944..782bc8060 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -106,18 +106,31 @@ menu "LWIP" help Enabling this option allows checking for available data on a netconn. - config LWIP_IP_FRAG - bool "Enable fragment outgoing IP packets" + config LWIP_IP4_FRAG + bool "Enable fragment outgoing IP4 packets" default y help - Enabling this option allows fragmenting outgoing IP packets if their size + Enabling this option allows fragmenting outgoing IP4 packets if their size exceeds MTU. - config LWIP_IP_REASSEMBLY - bool "Enable reassembly incoming fragmented IP packets" + config LWIP_IP6_FRAG + bool "Enable fragment outgoing IP6 packets" + default y + help + Enabling this option allows fragmenting outgoing IP6 packets if their size + exceeds MTU. + + config LWIP_IP4_REASSEMBLY + bool "Enable reassembly incoming fragmented IP4 packets" default n help - Enabling this option allows reassemblying incoming fragmented IP packets. + Enabling this option allows reassemblying incoming fragmented IP4 packets. + + config LWIP_IP6_REASSEMBLY + bool "Enable reassembly incoming fragmented IP6 packets" + default n + help + Enabling this option allows reassemblying incoming fragmented IP6 packets. config LWIP_STATS bool "Enable LWIP statistics" diff --git a/components/lwip/lwip b/components/lwip/lwip index f02243aa5..f4cb3e860 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit f02243aa5f04f6e453e83ecad4700691b9f919d0 +Subproject commit f4cb3e860c465041d13852a221efd6b75d97d67e diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index 4f77df17d..d46a0bd2b 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -157,18 +157,32 @@ -------------------------------- */ /** - * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that + * IP_REASSEMBLY==1: Reassemble incoming fragmented IP4 packets. Note that * this option does not affect outgoing packet sizes, which can be controlled * via IP_FRAG. */ -#define IP_REASSEMBLY CONFIG_LWIP_IP_REASSEMBLY +#define IP_REASSEMBLY CONFIG_LWIP_IP4_REASSEMBLY /** - * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note + * LWIP_IPV6_REASS==1: reassemble incoming IP6 packets that fragmented. Note that + * this option does not affect outgoing packet sizes, which can be controlled + * via LWIP_IPV6_FRAG. + */ +#define LWIP_IPV6_REASS CONFIG_LWIP_IP6_REASSEMBLY + +/** + * IP_FRAG==1: Fragment outgoing IP4 packets if their size exceeds MTU. Note * that this option does not affect incoming packet sizes, which can be * controlled via IP_REASSEMBLY. */ -#define IP_FRAG CONFIG_LWIP_IP_FRAG +#define IP_FRAG CONFIG_LWIP_IP4_FRAG + +/** + * LWIP_IPV6_FRAG==1: Fragment outgoing IP6 packets if their size exceeds MTU. Note + * that this option does not affect incoming packet sizes, which can be + * controlled via IP_REASSEMBLY. + */ +#define LWIP_IPV6_FRAG CONFIG_LWIP_IP6_FRAG /** * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally)