Verify min MTU for IPv6 packet too big

Bug #68610, Reported by Daniel Birtwhistle
This commit is contained in:
Erik Ekman
2026-09-01 13:26:18 +02:00
parent f89407ea71
commit d08f4773ed

View File

@@ -947,9 +947,14 @@ nd6_input(struct pbuf *p, struct netif *inp)
return; return;
} }
pmtu = lwip_htonl(icmp6hdr->data) & 0xFFFF;
if (pmtu < IP6_MIN_MTU_LENGTH) {
/* MTU too small */
pbuf_free(p);
return;
}
/* Change the Path MTU. */ /* Change the Path MTU. */
pmtu = lwip_htonl(icmp6hdr->data); destination_cache[dest_idx].pmtu = (u16_t)pmtu;
destination_cache[dest_idx].pmtu = (u16_t)LWIP_MIN(pmtu, 0xFFFF);
break; /* ICMP6_TYPE_PTB */ break; /* ICMP6_TYPE_PTB */
} }