Skip to content

Commit

Permalink
gnrc_ipv6: add comment why *netapi_dispatch_receive is not possible
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Aug 29, 2015
1 parent d9e02da commit 0c6e6b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Expand Up @@ -133,8 +133,11 @@ void gnrc_ipv6_demux(kernel_pid_t iface, gnrc_pktsnip_t *pkt, uint8_t nh)
return;
}

gnrc_pktbuf_hold(pkt, receiver_num - 1);
/* IPv6 is not interested anymore so `- 1` */
gnrc_pktbuf_hold(pkt, receiver_num - 1); /* IPv6 is not interested anymore so `- 1` */

/* XXX can't use gnrc_netapi_dispatch_receive() twice here since a call to that function
* implicitly hands all rights to the packet to one of the receiving threads. As a result,
* the second call to gnrc_netapi_dispatch_receive() would be invalid */
_dispatch_rcv_pkt(pkt->type, GNRC_NETREG_DEMUX_CTX_ALL, pkt);
_dispatch_rcv_pkt(GNRC_NETTYPE_IPV6, nh, pkt);
}
Expand Down

0 comments on commit 0c6e6b7

Please sign in to comment.