Skip to content

Commit

Permalink
Use ipv6 based netowkring
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Apr 23, 2024
1 parent 3a95f58 commit 3fb42aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ pub mod tailscale {
/// ```
pub fn interface() -> Option<IpAddr> {
let ifaces = datalink::interfaces();
let netmask: IpNetwork = "100.64.0.0/10".parse().unwrap();
//let netmask: IpNetwork = "100.64.0.0/10".parse().unwrap();
ifaces
.iter()
.filter(|iface| maybe_tailscale(&iface.name))
.flat_map(|iface| iface.ips.clone())
.filter(|ipnet| ipnet.is_ipv6() && netmask.contains(ipnet.network()))
.filter(|ipnet| ipnet.is_ipv6())
.map(|ipnet| ipnet.ip())
.next()
}
Expand Down

0 comments on commit 3fb42aa

Please sign in to comment.