libsa/ip: stop read loop on bad fragments

Lets try to clear out from case of overlapping etc fragments and stop read.

Reported by:	Dan McDonald
This commit is contained in:
Toomas Soome 2017-10-18 08:06:05 +00:00
parent 9d3fb104c9
commit 47243561f4

View File

@ -350,7 +350,8 @@ readipv4(struct iodesc *d, void **pkt, void **payload, time_t tleft,
last = NULL;
STAILQ_FOREACH(ipq, &ipr->ip_queue, ipq_next) {
if ((ntohs(ipq->ipq_hdr->ip_off) & IP_OFFMASK) != n / 8) {
errno = EAGAIN;
STAILQ_REMOVE(&ire_list, ipr, ip_reasm, ip_next);
ip_reasm_free(ipr);
return (-1);
}