> One thing that was not clear to me about the API: shouldn't UDP_SEGMENT > just be automatically determined in the stack from the pmtu? Whats > the motivation for the socket option for this? also AIUI this can be > either a per-socket or a per-packet option?
I decided to let the application explicitly set segment size, to avoid bugs from the application assuming a different MTU from the one used in the kernel for segmentation. With path MTU, it is too easy for a process to incorrectly assume link MTU or stale path MTU. With the current interface, if a process tries to assemble segments larger than relevant path MTU, the send call will fail. A process may also explicitly want to send a chain of packets smaller than MTU.