1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

ng_sixlowpan: write protect pkt

This commit is contained in:
Martine Lenders 2015-06-19 14:52:51 +02:00
parent 910ade1fb2
commit b3acefd340

View File

@ -59,6 +59,21 @@ void _receive(ng_pktsnip_t *pkt)
uint8_t *dispatch;
ng_netreg_entry_t *entry;
/* seize payload as a temporary variable */
payload = ng_pktbuf_start_write(pkt); /* need to duplicate since pkt->next
* might get replaced */
if (payload == NULL) {
DEBUG("6lo: can not get write access on received packet\n");
#if defined(DEVELHELP) && defined(ENABLE_DEBUG)
ng_pktbuf_stats();
#endif
ng_pktbuf_release(pkt);
return;
}
pkt = payload; /* reset pkt from temporary variable */
LL_SEARCH_SCALAR(pkt, payload, type, NG_NETTYPE_SIXLOWPAN);
if ((payload == NULL) || (payload->size < 1)) {