Open darnuria opened 5 months ago
Hello, thanks for the review, will do the changes today.
Sorry @darnuria I didn't have time to review this last weekend and I don't think I'll have time the next two weeks either, so it's going to take a little while.
Hello first contribution here! It may need some careful review since MTU management is a bit complicated and not so portable.
Add ways to set Path Discovery MTU for Linux on a Socket. (it may not work on freebsd EDIT: CI confirmed it! but may work on Windows subsystem and winsock: https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options.
This contribution use
setsocketops
to configure Dont Fragment (DF) bit and OS behavior related to PMTU.It introduce
PathMtuDiscoveringMode
enum to manage it rust-way and 4 functions respectively for ipv4/v6 and set/get.Omit and Interface exist but are not widely documented.
Initially It started by preparing a PR for the patch purposed here: https://github.com/rust-lang/socket2/issues/487
Context: Why it can be needed in a rust library? Some protocols such as DNS in UDP or traceroute needs to manage the MTU on a socket level.
Exemples: