Skip to content
Open
Changes from all commits
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
12 changes: 6 additions & 6 deletions tests/mdns_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,19 +755,19 @@ fn test_disable_interface_cache() {
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap();
let instance_name = now.as_micros().to_string();
let service_ip_addr = my_ip_interfaces()
let ipv4_list: Vec<_> = my_ip_interfaces()
.iter()
.find(|iface| iface.ip().is_ipv4())
.map(|iface| iface.ip())
.unwrap();
.filter(|ip| ip.is_ipv4() && !ip.is_loopback())
.collect();

let host_name = "disabled_intf_host.local.";
let port = 5201;
let my_service = ServiceInfo::new(
ty_domain,
&instance_name,
host_name,
service_ip_addr,
&ipv4_list[..],
port,
None,
)
Expand All @@ -783,8 +783,8 @@ fn test_disable_interface_cache() {
sleep(Duration::from_secs(1));

// Disable the interface for the client.
println!("Disabling interface with IP: {service_ip_addr}");
client.disable_interface(service_ip_addr).unwrap();
println!("Disabling interface with IP: {:?}", ipv4_list);
client.disable_interface(ipv4_list).unwrap();

// Browse for the service.
let handle = client.browse(ty_domain).unwrap();
Expand Down