From 80487aac36e184b112278f0339a50c5f8f955447 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Sat, 15 May 2021 01:26:01 +0800 Subject: [PATCH] [udp] allow Reference Devices to send UDP messages to TMF port (#6627) This commit allows Reference Devices to send UDP messages to TMF port, which was prohibited by #5911 . Background: TestHarness sends constructed TMF messages in many TCs to validate the behavior of nodes on receiving these TMF messages. Fixes DUA-TC-09 --- src/core/net/ip6.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index 12ae8a910..a239fce16 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -1289,10 +1289,14 @@ start: sourcePort = HostSwap16(sourcePort); destPort = HostSwap16(destPort); +#if !OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE if (nextHeader == kProtoUdp) { VerifyOrExit(Get().ShouldUsePlatformUdp(destPort), error = kErrorDrop); } +#else + OT_UNUSED_VARIABLE(destPort); +#endif #if OPENTHREAD_CONFIG_UNSECURE_TRAFFIC_MANAGED_BY_STACK_ENABLE // check whether source port is an unsecure port