Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: enforce immutability #4

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ fn get_interface_mtu_linux_macos(socket: &UdpSocket) -> Result<usize, Error> {
use libc::{ifreq, ioctl};

// Get the interface list.
let mut ifap: *mut ifaddrs = ptr::null_mut(); // Do not modify this pointer.
let mut ifap: *mut ifaddrs = ptr::null_mut();
if unsafe { getifaddrs(&mut ifap) } != 0 {
return Err(Error::last_os_error());
}
let ifap = ifap; // Do not modify this pointer.

// First, find the name of the interface with the local IP address determined above.
let mut cursor = ifap;
Expand Down
Loading