mozilla / mtu

Rust crate for obtaining the local network interface name and MTU towards a given IP address
https://crates.io/crates/mtu
Apache License 2.0
12 stars 2 forks source link

fix: return (String, usize) on non-supported platforms #21

Closed mxinden closed 3 weeks ago

mxinden commented 1 month ago

On non-supported platforms, e.g. FreeBSD, the mtu crate is a no-op.

fn interface_and_mtu_impl(_socket: &UdpSocket) -> Result<(String, usize), Error> {
    default_result()
}

Previously the function signature was off with its unix and windows equivalents.

This commit updates the function signature and adds a CI smoke-test for FreeBSD.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.62%. Comparing base (8af1e02) to head (64d6e33). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #21 +/- ## ========================================== - Coverage 93.30% 92.62% -0.69% ========================================== Files 1 1 Lines 269 244 -25 ========================================== - Hits 251 226 -25 Misses 18 18 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

larseggert commented 1 month ago

https://github.com/mozilla/neqo/pull/2099 landed, so we can update this.