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