gnrc_sixlowpan_frag: drop received duplicates

Otherwise duplicate fragments are added to the number of already
received datagram bytes in L153 leading to possible race-conditions.
This commit is contained in:
Martine Lenders 2019-01-15 19:45:51 +01:00
parent 4e4e6f8793
commit 01370511df

View File

@ -139,7 +139,12 @@ static int _rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *pkt,
* https://tools.ietf.org/html/rfc4944#section-5.3 */ * https://tools.ietf.org/html/rfc4944#section-5.3 */
return RBUF_ADD_REPEAT; return RBUF_ADD_REPEAT;
} }
/* End was already checked in overlap check */
if (ptr->start == offset) {
DEBUG("6lo rbuf: fragment already in reassembly buffer");
gnrc_pktbuf_release(pkt);
return RBUF_ADD_SUCCESS;
}
ptr = ptr->next; ptr = ptr->next;
} }