mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
gnrc_rpl: exit early if netif_hdr is NULL in send function
Without this fix RPL might crash when the packet buffer is full.
This commit is contained in:
parent
579d9d78d4
commit
0c9d7aeedc
@ -114,6 +114,11 @@ void gnrc_rpl_send(gnrc_pktsnip_t *pkt, kernel_pid_t iface, ipv6_addr_t *src, ip
|
||||
pkt = hdr;
|
||||
|
||||
hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
if (hdr == NULL) {
|
||||
DEBUG("RPL: Send - no space left in packet buffer\n");
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return;
|
||||
}
|
||||
((gnrc_netif_hdr_t *)hdr->data)->if_pid = iface;
|
||||
LL_PREPEND(pkt, hdr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user