From a6e1c6ad2e46652c5942deba46ea2706c6b9524b Mon Sep 17 00:00:00 2001 From: Jiacheng Guo Date: Wed, 15 Jul 2020 11:37:27 +0800 Subject: [PATCH] [netif] fix pbuf allocation type and task execution (#33) - Fix wrong pbuf allocate type. - Always trigger OpenThread task after calling OpenThread apis. --- src/core/netif.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/netif.cpp b/src/core/netif.cpp index 301a45e1c..0f5d46756 100644 --- a/src/core/netif.cpp +++ b/src/core/netif.cpp @@ -302,7 +302,7 @@ static void processReceive(otMessage *aMessage, void *aContext) assert(sNetif.state == aInstance); - buffer = pbuf_alloc(PBUF_RAW, length, PBUF_POOL); + buffer = pbuf_alloc(PBUF_LINK, length, PBUF_POOL); VerifyOrExit(buffer != NULL, error = OT_ERROR_NO_BUFS); @@ -360,14 +360,11 @@ static void processTransmit(otInstance *aInstance) } // Notify if more - if (sHeadOutput != NULL) - { - otrTaskNotifyGive(); - } - else + if (sHeadOutput == NULL) { sLastOutput = NULL; } + otrTaskNotifyGive(); exit: if (error != OT_ERROR_NONE)