Files
Jonathan Hui d743255d1c [trel] check simulated socket port in simulation trel platform (#13906)
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`.
2026-11-10 08:05:40 -08:00
..