From 2612fbc927f9722d7d50b52565ce2d908c8d27a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Maciejo=C5=84czyk?= <32327281+lmaciejonczyk@users.noreply.github.com> Date: Tue, 8 Mar 2022 18:21:39 +0100 Subject: [PATCH] [ip6] forward IPv6 fragments only if reassebling is disabled (#7449) IPv6 fragments are unconditionally forwarded to the host even if the option: OT_IP6_FRAGM for internal reassembling is enabled. It results with e.g. for RCP echo request are handled twice, by the OpenThread and by the host. This commit changes it in this way that when OT_IP6_FRAGM is enabled IPv6 fragments are not forwarded to the host any more but handled internally only. When OT_IP6_FRAGM is disabled the IPv6 fragments are always forwarded to the host. This case is especially important for NCP architecture with spinel maximum frame size limitation (1500B). Now the option: OT_IP6_FRAGM should be disabled for NCP to allow forwarding IPv6 fragments to the host. --- src/core/net/ip6.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index 62c1732ca..a13c99df7 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -912,10 +912,10 @@ Error Ip6::HandleExtensionHeaders(Message & aMessage, break; case kProtoFragment: - // Always forward IPv6 fragments to the Host. +#if !OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE IgnoreError(ProcessReceiveCallback(aMessage, aMessageInfo, aNextHeader, aFromHost, /* aAllowReceiveFilter */ false, Message::kCopyToUse)); - +#endif SuccessOrExit(error = HandleFragment(aMessage, aNetif, aMessageInfo, aFromHost)); break;