From 616b11aa58d926f3b1bca397c96059bb232b4f58 Mon Sep 17 00:00:00 2001 From: Suvesh Pratapa Date: Sun, 14 Apr 2024 20:57:58 -0400 Subject: [PATCH] [posix] set message origin to host trusted for reference devices Reference devices that are part of the Thread test harness construct CoAP packets sent on TMF port 61631 for certain tests, for example in the 5.9.x series where they have to force address errors (a/ae) for duplicate DUA or re-registration tests. These tests started to fail when reference device firmware was updated recently to a newer OpenThread stack that included the change in https://github.com/openthread/openthread/pull/9437. Example: ``` udp send fd00:db9:0:0:0:ff:fe00:5000 61631 -x 4102d63697b16e02646eff0401010010fd007d037d037d0389c3a350cdcf36e0' Ip6-----------: Dropping TMF message from untrusted origin ``` For certification purposes, we need to trust messages sent by reference devices. --- src/posix/platform/netif.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/posix/platform/netif.cpp b/src/posix/platform/netif.cpp index e0a4c49b87a6..ca9cb1286f95 100644 --- a/src/posix/platform/netif.cpp +++ b/src/posix/platform/netif.cpp @@ -1232,7 +1232,11 @@ static void processTransmit(otInstance *aInstance) message = otIp6NewMessage(aInstance, &settings); #endif VerifyOrExit(message != nullptr, error = OT_ERROR_NO_BUFS); +#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE + otMessageSetOrigin(message, OT_MESSAGE_ORIGIN_HOST_TRUSTED); +#else otMessageSetOrigin(message, OT_MESSAGE_ORIGIN_HOST_UNTRUSTED); +#endif } #if OPENTHREAD_POSIX_LOG_TUN_PACKETS