Thank you. I am trying to summarize it
1. core option pmtu_discovery for IPv4 - exists a long time - sets socket option IP_PMTUDISC_DO - sets do not fragment bit in outgoing packets - kernel will implement PMTU discovery, initial UDP packets might be dropped while the kernel tries to figure out the MTU - if MTU is found, UDP will be delivered and kernel will store the discovered MTU internally - further packets will use this value - this is probably not really efficient, but probably works
2. core option pmtu_discovery for IPv6 - new introduced in this PR - set socket option IP_PMTUDISC_DO - will not set do not fragment bit in outgoing packets - the kernel will refuse larger packets with EMSGSIZE - no discovery will take place, Kamailio will probably just stop sending the packet
3. suggestion in this PR for IPv6 - use IPV6_PMTUDISC_WANT as socket option - will fragment a datagram if needed according to the path MTU for IPv6 - probably could be set by adding a new core option
4. suggestion in this PR for IPv4 - use IP_PMTUDISC_WANT as socket option - will fragment a datagram if needed according to the path MTU, or will set the don't-fragment flag otherwise - probably could be set by adding a new core option
5. Additionally Kamailio provide options to manually manage the MTU with usual sockets - core setting udp_mtu and udp_mtu_try_proto - will try another protocol if MTU exceeded internally
6. Additionally Kamailio provide options to manually manage the MTU with RAW sockets - core option udp4_raw_mtu - will fragment the packets internally
My suggestion would be add a new value **2** to the pmtu_discovery core parameter, which sets then the _WANT socket option for IPv4 and IPv6.