From 00d0ed50d7341c0e182e3a2556a3224ea0bf6de6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 22 Sep 2023 01:22:27 -0400 Subject: [PATCH 1/2] Don't use LwIP defines if CHIP_SYSTEM_CONFIG_USE_LWIP is not set. Fixes https://github.com/project-chip/connectedhomeip/issues/29211 --- src/messaging/ReliableMessageProtocolConfig.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/messaging/ReliableMessageProtocolConfig.h b/src/messaging/ReliableMessageProtocolConfig.h index bd0e421933a3a1..4f1908de563561 100644 --- a/src/messaging/ReliableMessageProtocolConfig.h +++ b/src/messaging/ReliableMessageProtocolConfig.h @@ -25,6 +25,7 @@ */ #pragma once +#include #include #include #include @@ -122,15 +123,23 @@ namespace chip { * */ #ifndef CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE -#if LWIP_PBUF_FROM_CUSTOM_POOLS -#define CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS -#elif PBUF_POOL_SIZE +#if CHIP_SYSTEM_CONFIG_USE_LWIP + +#if !LWIP_PBUF_FROM_CUSTOM_POOLS && PBUF_POOL_SIZE != 0 #define CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE std::min(PBUF_POOL_SIZE, CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS) -#elif CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE != 0 +#else +#define CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS +#endif // !LWIP_PBUF_FROM_CUSTOM_POOLS && PBUF_POOL_SIZE != 0 + +#else // CHIP_SYSTEM_CONFIG_USE_LWIP + +#if CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE != 0 #define CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE std::min(CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE, CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS) #else #define CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS -#endif // PBUF_POOL_SIZE +#endif // CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE != 0 + +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP #endif // CHIP_CONFIG_RMP_RETRANS_TABLE_SIZE /** From 8abb92cfc5eed98f69ee7c0b15df535bad6361c7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 22 Sep 2023 10:56:39 -0400 Subject: [PATCH 2/2] Address review comment. --- src/messaging/ReliableMessageProtocolConfig.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/messaging/ReliableMessageProtocolConfig.h b/src/messaging/ReliableMessageProtocolConfig.h index 4f1908de563561..a49740ad4d5227 100644 --- a/src/messaging/ReliableMessageProtocolConfig.h +++ b/src/messaging/ReliableMessageProtocolConfig.h @@ -30,6 +30,10 @@ #include #include +#if CHIP_SYSTEM_CONFIG_USE_LWIP +#include +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP + namespace chip { /**