Merge pull request #10869 from gschorcht/gnrc_icmpv6_echo_fix
gnrc_icmpv6_echo: avoid crashing when pktbuf full
This commit is contained in:
commit
2d54069f59
@ -93,6 +93,12 @@ void gnrc_icmpv6_echo_req_handle(gnrc_netif_t *netif, ipv6_hdr_t *ipv6_hdr,
|
||||
pkt = hdr;
|
||||
hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
|
||||
if (hdr == NULL) {
|
||||
DEBUG("icmpv6_echo: no space left in packet buffer\n");
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return;
|
||||
}
|
||||
|
||||
if (netif != NULL) {
|
||||
((gnrc_netif_hdr_t *)hdr->data)->if_pid = netif->pid;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user