ipv6: frag: fix bogus icmp6 response on reassembly timeout

See bug #63929
This commit is contained in:
Simon Goldschmidt 2023-10-03 17:50:28 +02:00
parent 1ef6189287
commit f85ed72bac

View File

@ -162,7 +162,7 @@ ip6_reass_free_complete_datagram(struct ip6_reassdata *ipr)
ipr->p = iprh->next_pbuf;
/* Restore the part that we've overwritten with our helper structure, or we
* might send garbage (and disclose a pointer) in the ICMPv6 reply. */
MEMCPY(p->payload, ipr->orig_hdr, sizeof(iprh));
MEMCPY(p->payload, ipr->orig_hdr, sizeof(*iprh));
/* Then, move back to the original ipv6 header (we are now pointing to Fragment header).
This cannot fail since we already checked when receiving this fragment. */
if (pbuf_header_force(p, (s16_t)((u8_t*)p->payload - (u8_t*)ipr->iphdr))) {