diff --git a/sys/net/gnrc/network_layer/sixlowpan/frag/rbuf.c b/sys/net/gnrc/network_layer/sixlowpan/frag/rbuf.c index 394c6c5252ef2..9ca95f9375dda 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/frag/rbuf.c +++ b/sys/net/gnrc/network_layer/sixlowpan/frag/rbuf.c @@ -21,6 +21,9 @@ #include "net/gnrc.h" #include "net/gnrc/sixlowpan.h" #include "net/gnrc/sixlowpan/frag.h" +#ifdef MODULE_GNRC_SIXLOWPAN_FRAG_VRB +#include "net/gnrc/sixlowpan/frag/vrb.h" +#endif /* MODULE_GNRC_SIXLOWPAN_FRAG_VRB */ #include "net/sixlowpan.h" #include "thread.h" #include "xtimer.h" @@ -264,7 +267,7 @@ void rbuf_gc(void) for (i = 0; i < RBUF_SIZE; i++) { /* since pkt occupies pktbuf, aggressivly collect garbage */ - if ((rbuf[i].pkt != NULL) && + if (!rbuf_entry_empty(&rbuf[i]) && ((now_usec - rbuf[i].super.arrival) > RBUF_TIMEOUT)) { DEBUG("6lo rfrag: entry (%s, ", gnrc_netif_addr_to_str(rbuf[i].super.src, @@ -280,6 +283,9 @@ void rbuf_gc(void) rbuf_rm(&(rbuf[i])); } } +#ifdef MODULE_GNRC_SIXLOWPAN_FRAG_VRB + gnrc_sixlowpan_frag_vrb_gc(); +#endif } static inline void _set_rbuf_timeout(void)