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

feat: Allow passing in local and remote socket addresses #16

Merged
merged 24 commits into from
Sep 5, 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
Prev Previous commit
Next Next commit
No v6 on GitHub
  • Loading branch information
larseggert committed Sep 4, 2024
commit d3d6891bd193637faf3c09276c8bbeec6aed225a
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ pub fn get_interface_mtu(remote: &SocketAddr) -> Result<usize, Error> {

#[cfg(test)]
mod test {
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, UdpSocket};
use std::{
env,
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, UdpSocket},
};

use rand::Rng;

Expand Down Expand Up @@ -451,6 +454,10 @@ mod test {

#[test]
fn none_inet_v6() {
if env::var("CI").is_ok() {
larseggert marked this conversation as resolved.
Show resolved Hide resolved
// The GitHub CI environment does not have IPv6 connectivity.
return;
}
assert!(interface_and_mtu((None, inet_v6())).unwrap() == INET);
}

Expand Down
Loading