Skip to content

Commit

Permalink
[posix] set message origin to host trusted for reference devices
Browse files Browse the repository at this point in the history
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 openthread#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.
  • Loading branch information
suveshpratapa committed Apr 16, 2024
1 parent 43cb7a0 commit 616b11a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/posix/platform/netif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 616b11a

Please sign in to comment.