From 99c753a6ad892edf59b2951e89ba1a5143ee1c49 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Fri, 28 Dec 2018 07:55:17 +0800 Subject: [PATCH] [message] allocate message with corresponding component (#3403) --- src/core/api/ip6_api.cpp | 2 +- src/core/api/udp_api.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;