[ip6] do not free the same message twice while handling IPv6 fragment (#4940)

This commit fixes the serious bug when IPv6 fragmentation is
enabled. It is possible that HandleDatagram which is called on
complete reassembly, returns the error (e.g. because ICMPv6 Echo
Response can't be generated due to lack of buffers). In such case both
HandleDatagram method and HandleFragment tries to free the same
message which finally ends up in a crash of the system.
This commit is contained in:
Duda, Lukasz
2020-05-11 15:22:18 -07:00
committed by Jonathan Hui
parent 9aa7340eb2
commit 069afa5a17
+1 -1
View File
@@ -820,7 +820,7 @@ otError Ip6::HandleFragment(Message &aMessage, Netif *aNetif, MessageInfo &aMess
mReassemblyList.Dequeue(*message);
error = HandleDatagram(*message, aNetif, aMessageInfo.mLinkInfo, aFromNcpHost);
IgnoreError(HandleDatagram(*message, aNetif, aMessageInfo.mLinkInfo, aFromNcpHost));
}
exit: