mirror of
https://github.com/espressif/openthread.git
synced 2026-11-10 16:31:11 +00:00
In `examples/platforms/simulation/trel.c`, `sSockAddr` tracks the simulated node's TREL IPv6 socket address and port, which can be updated at runtime by `treltest changesockaddr` and `treltest changesockport`. However, `processMessage()` checked incoming `TREL_DATA_MESSAGE` destination ports against the initial `sSocket.mPort` instead of `sSockAddr.mPort`. After `treltest changesockport` changed a node's simulated TREL port in `test-706-multi-radio-trel-peer-addr-port-change-discovery.py`: - The node continued accepting TREL broadcast packets sent by peers to its old port and replied with TREL ACKs from its new port. On receiving the unauthenticated TREL ACK, the peer incremented `sNotifyAddressDiffCounter` without updating the peer's recorded socket address, and then incremented it a second time upon receiving the node's next MLE Advertisement, causing `verify()` at line 152 to fail (`3 != 2`). - Once peers updated the node's TREL port to the new port, the node dropped all subsequent TREL packets sent to its new port. This commit updates `processMessage()` and `otPlatTrelEnable()` in simulation `trel.c` to use `sSockAddr.mPort`.