|
|
|
@ -55,7 +55,7 @@ pub fn interfaces() -> Vec<Interface> { |
|
|
|
|
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<Interface> { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
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); |
|
|
|
|