diff --git a/src/core/api/ip6_api.cpp b/src/core/api/ip6_api.cpp index 68fd48c58..524a32a2f 100644 --- a/src/core/api/ip6_api.cpp +++ b/src/core/api/ip6_api.cpp @@ -211,7 +211,7 @@ otMessage *otIp6NewMessage(otInstance *aInstance, const otMessageSettings *aSett VerifyOrExit(aSettings->mPriority <= OT_MESSAGE_PRIORITY_HIGH, message = NULL); } - message = instance.GetMessagePool().New(Message::kTypeIp6, 0, aSettings); + message = instance.GetIp6().NewMessage(0, aSettings); exit: return message; diff --git a/src/core/api/udp_api.cpp b/src/core/api/udp_api.cpp index b1e2a54e6..11fda2255 100644 --- a/src/core/api/udp_api.cpp +++ b/src/core/api/udp_api.cpp @@ -50,7 +50,7 @@ otMessage *otUdpNewMessage(otInstance *aInstance, const otMessageSettings *aSett VerifyOrExit(aSettings->mPriority <= OT_MESSAGE_PRIORITY_HIGH, message = NULL); } - message = instance.GetMessagePool().New(Message::kTypeIp6, 0, aSettings); + message = instance.GetIp6().GetUdp().NewMessage(0, aSettings); exit: return message;