Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ip6] update tunnel message receive in
HandleDatagram()
(#9503)
This commit updates how `Ip6::HandleDatagram()` processes a tunneled IP-in-IP message. Previously, if a message was marked for both `receive` and `forwardThread`, e.g., possible for a multicast message from host with multicast-loop flag, it would be received but not forwarded to the Thread mesh. This commit ensures that such messages are handled properly. Without this change, multicast transmission still works fine due to the MPL layer retransmitting the message, which would then be forwarded to the Thread mesh. However, this change improves the multicast behavior by ensuring that the original/first message is also forwarded to the Thread mesh. This commit changes the code so that if we need to both `receive` and `forwardThread`, we create a copy of the message by cloning it. Otherwise, we take ownership of the original message and use it directly. We then remove the encapsulating header before processing the embedded message by calling the `HandleDatagram()` recursively.
- Loading branch information