From 0251d6585ed1bb4419d087fe416c260c3386c113 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Fri, 29 Nov 2019 18:00:54 +0100 Subject: [PATCH] gnrc_sixlowpan_frag_rb: error when interval buffer is full --- .../sixlowpan/frag/rb/gnrc_sixlowpan_frag_rb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/gnrc/network_layer/sixlowpan/frag/rb/gnrc_sixlowpan_frag_rb.c b/sys/net/gnrc/network_layer/sixlowpan/frag/rb/gnrc_sixlowpan_frag_rb.c index 7a08aee543..a0f782ef28 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/frag/rb/gnrc_sixlowpan_frag_rb.c +++ b/sys/net/gnrc/network_layer/sixlowpan/frag/rb/gnrc_sixlowpan_frag_rb.c @@ -307,6 +307,12 @@ static int _rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *pkt, memcpy(((uint8_t *)entry->pkt->data) + offset, data, frag_size); } + else { + /* no space left in rbuf interval buffer*/ + gnrc_pktbuf_release(entry->pkt); + gnrc_sixlowpan_frag_rb_remove(entry); + res = RBUF_ADD_ERROR; + } /* no errors and not consumed => release packet */ gnrc_pktbuf_release(pkt); return res;