Add some basic checks on the segments offset and length metadata:
always funny to have a < 0 tailroom cast to uint16_t ;-).
Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
pkt_len = m->pkt_len;
do {
+ if (m->data_off > m->buf_len)
+ rte_panic("data offset too big in mbuf segment\n");
+ if (m->data_off + m->data_len > m->buf_len)
+ rte_panic("data length too big in mbuf segment\n");
nb_segs -= 1;
pkt_len -= m->data_len;
} while ((m = m->next) != NULL);