On input ICMP handler is updating tcp_hostcache with the PMTU value.
On output calculate MTU based on the route/interface and hostcache.
Unit Tests Skipped
SCTP and TCP do a similar handling, but only after performing some checks (port numbers and vtag in case of SCTP, port numbers and sequence number in case of TCP) to make it non-trivial for an off-path attacker to generate an ICMP message, which will be accepted and the corresponding MTU will be cached.
How is such an check done in this context?