Hello,
I've looked through a bunch of network interface crates. None of them have the letters "MTU" in any docs, issues, or structs. I must be thinking about something incorrectly. I don't know much about libc and less about the Windows equivalent.
Would be great if worked on macos and windows too.
You can do it with neli, but as you said it's netlink only. It's also not trivial — you need to know the netlink protocols. I don't think there's a cross-platform solution.
Is the MTU of the local interface really all that useful? I thought one needed to do Path MTU Discovery - Wikipedia to figure it out for a particular endpoint.
I have a different program, not written in rust, which sets up interfaces. I thought I'd make some integrationy tests and get a little better at rust. MTU is just one of the things to check. I can just punt on MTU for now and do the rest I guess.
The other motivation to use rust is it supports more platforms than some of the other options I'm semi competent in.
The information can be found in /sys/class/net/*/mtu in linux, which I recognise is not the ideal approach you're looking for. A search for the C struct ifreq in Rust projects seems to indicate no standard crate for this, unfortunately.