mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
ng_sixlowpan: use new netapi functions
This commit is contained in:
parent
59f62e5366
commit
018dbb04b8
@ -57,7 +57,6 @@ static void _receive(ng_pktsnip_t *pkt)
|
|||||||
{
|
{
|
||||||
ng_pktsnip_t *payload;
|
ng_pktsnip_t *payload;
|
||||||
uint8_t *dispatch;
|
uint8_t *dispatch;
|
||||||
ng_netreg_entry_t *entry;
|
|
||||||
|
|
||||||
/* seize payload as a temporary variable */
|
/* seize payload as a temporary variable */
|
||||||
payload = ng_pktbuf_start_write(pkt); /* need to duplicate since pkt->next
|
payload = ng_pktbuf_start_write(pkt); /* need to duplicate since pkt->next
|
||||||
@ -138,21 +137,9 @@ static void _receive(ng_pktsnip_t *pkt)
|
|||||||
|
|
||||||
payload->type = NG_NETTYPE_IPV6;
|
payload->type = NG_NETTYPE_IPV6;
|
||||||
|
|
||||||
entry = ng_netreg_lookup(NG_NETTYPE_IPV6, NG_NETREG_DEMUX_CTX_ALL);
|
if (!ng_netapi_dispatch_receive(NG_NETTYPE_IPV6, NG_NETREG_DEMUX_CTX_ALL, pkt)) {
|
||||||
|
|
||||||
if (entry == NULL) {
|
|
||||||
DEBUG("ipv6: No receivers for this packet found\n");
|
DEBUG("ipv6: No receivers for this packet found\n");
|
||||||
ng_pktbuf_release(pkt);
|
ng_pktbuf_release(pkt);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ng_pktbuf_hold(pkt, ng_netreg_num(NG_NETTYPE_IPV6, NG_NETREG_DEMUX_CTX_ALL) - 1);
|
|
||||||
|
|
||||||
while (entry) {
|
|
||||||
DEBUG("6lo: Send receive command for %p to %" PRIu16 "\n",
|
|
||||||
(void *)pkt, entry->pid);
|
|
||||||
ng_netapi_receive(entry->pid, pkt);
|
|
||||||
entry = ng_netreg_getnext(entry);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user