gnrc_ipv6.c: remove padding added by lower layers

This commit is contained in:
Cenk Gündoğan 2015-08-20 00:10:37 +02:00
parent c83ba9e8f2
commit 29ccba3e2f

View File

@ -656,6 +656,12 @@ static void _receive(gnrc_pktsnip_t *pkt)
/* extract header */
hdr = (ipv6_hdr_t *)ipv6->data;
/* if available, remove any padding that was added by lower layers
* to fulfill their minimum size requirements (e.g. ethernet) */
if (byteorder_ntohs(hdr->len) < pkt->size) {
gnrc_pktbuf_realloc_data(pkt, byteorder_ntohs(hdr->len));
}
DEBUG("ipv6: Received (src = %s, ",
ipv6_addr_to_str(addr_str, &(hdr->src), sizeof(addr_str)));
DEBUG("dst = %s, next header = %" PRIu8 ", length = %" PRIu16 ")\n",