diff --git a/src/interface/unix.rs b/src/interface/unix.rs index b7ec31b..a646664 100644 --- a/src/interface/unix.rs +++ b/src/interface/unix.rs @@ -55,7 +55,7 @@ pub fn interfaces() -> Vec { for iface in &mut interfaces { match local_ip { IpAddr::V4(local_ipv4) => { - if iface.ipv4.contains(&local_ipv4) { + if iface.ipv4.iter().any(|x| x.addr == local_ipv4) { match gateway::linux::get_default_gateway(iface.name.clone()) { Ok(gateway) => { iface.gateway = Some(gateway); @@ -65,7 +65,7 @@ pub fn interfaces() -> Vec { } }, IpAddr::V6(local_ipv6) => { - if iface.ipv6.contains(&local_ipv6) { + if iface.ipv6.iter().any(|x| x.addr == local_ipv6) { match gateway::linux::get_default_gateway(iface.name.clone()) { Ok(gateway) => { iface.gateway = Some(gateway);