Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
[netif] fix pbuf allocation type and task execution (#33)
Browse files Browse the repository at this point in the history
- Fix wrong pbuf allocate type.
- Always trigger OpenThread task after calling OpenThread apis.
  • Loading branch information
gjc13 authored Jul 15, 2020
1 parent 82fd228 commit a6e1c6a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/core/netif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a6e1c6a

Please sign in to comment.