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

Commit a6e1c6a

Browse files
authored
[netif] fix pbuf allocation type and task execution (#33)
- Fix wrong pbuf allocate type. - Always trigger OpenThread task after calling OpenThread apis.
1 parent 82fd228 commit a6e1c6a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/core/netif.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static void processReceive(otMessage *aMessage, void *aContext)
302302

303303
assert(sNetif.state == aInstance);
304304

305-
buffer = pbuf_alloc(PBUF_RAW, length, PBUF_POOL);
305+
buffer = pbuf_alloc(PBUF_LINK, length, PBUF_POOL);
306306

307307
VerifyOrExit(buffer != NULL, error = OT_ERROR_NO_BUFS);
308308

@@ -360,14 +360,11 @@ static void processTransmit(otInstance *aInstance)
360360
}
361361

362362
// Notify if more
363-
if (sHeadOutput != NULL)
364-
{
365-
otrTaskNotifyGive();
366-
}
367-
else
363+
if (sHeadOutput == NULL)
368364
{
369365
sLastOutput = NULL;
370366
}
367+
otrTaskNotifyGive();
371368

372369
exit:
373370
if (error != OT_ERROR_NONE)

0 commit comments

Comments
 (0)