From b0beba3c1cd18d1442a77db553f07fc2089dce62 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 25 Jan 2019 00:03:21 +0100 Subject: [PATCH] gnrc_ipv6_nib: release when not queuable on AR When a new queue entry is tried to be allocated for a neighbor who's address is currently tried to be resolved there was no error case before. The packet that was tried to be put in the queue was thus not released and stayed in the packet buffer for ever. --- sys/net/gnrc/network_layer/ipv6/nib/nib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib.c b/sys/net/gnrc/network_layer/ipv6/nib/nib.c index a749f9a87c..8189482714 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib.c @@ -1171,6 +1171,12 @@ static bool _resolve_addr(const ipv6_addr_t *dst, gnrc_netif_t *netif, } gnrc_pktqueue_add(&entry->pktqueue, queue_entry); } + else { + DEBUG("nib: can't allocate entry for packet queue " + "dropping packet\n"); + gnrc_pktbuf_release(pkt); + return false; + } } else { gnrc_icmpv6_error_dst_unr_send(ICMPV6_ERROR_DST_UNR_ADDR,