Skip to content

Commit

Permalink
fixup! Merge pull request RIOT-OS#10887 from aabadie/pr/make/distclea…
Browse files Browse the repository at this point in the history
…n_cleanup
  • Loading branch information
miri64 committed Jan 29, 2019
1 parent a249ebd commit 33da43b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sys/net/gnrc/network_layer/sixlowpan/frag/rbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,19 @@ enum {
RBUF_ADD_SUCCESS,
RBUF_ADD_ERROR,
RBUF_ADD_REPEAT,
RBUF_ADD_HANDOVER,
};

void rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *pkt,
size_t offset, unsigned page)
{
if (_rbuf_add(netif_hdr, pkt, offset, page) == RBUF_ADD_REPEAT) {
_rbuf_add(netif_hdr, pkt, offset, page);
int res;
if ((res = _rbuf_add(netif_hdr, pkt, offset, page)) == RBUF_ADD_REPEAT) {
res = _rbuf_add(netif_hdr, pkt, offset, page);
}
if (res != RBUF_ADD_HANDOVER) {
gnrc_pktbuf_release(pkt);
}
gnrc_pktbuf_release(pkt);
}

static int _rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *pkt,
Expand Down Expand Up @@ -166,7 +170,7 @@ static int _rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *pkt,
return RBUF_ADD_ERROR;
}
gnrc_sixlowpan_iphc_recv(pkt, &entry->super, 0);
return RBUF_ADD_SUCCESS;
return RBUF_ADD_HANDOVER;
}
else
#endif
Expand Down

0 comments on commit 33da43b

Please sign in to comment.