()
| 2881 | } |
| 2882 | |
| 2883 | fn detect_tailscale_ip_from_ifconfig() -> Option<IpAddr> { |
| 2884 | let output = ProcessCommand::new("ifconfig") |
| 2885 | .stdout(Stdio::piped()) |
| 2886 | .stderr(Stdio::null()) |
| 2887 | .output() |
| 2888 | .ok()?; |
| 2889 | if !output.status.success() { |
| 2890 | return None; |
| 2891 | } |
| 2892 | let text = String::from_utf8_lossy(&output.stdout); |
| 2893 | text.split_whitespace() |
| 2894 | .filter_map(|part| part.parse::<IpAddr>().ok()) |
| 2895 | .find(|ip| is_tailscale_ip(*ip)) |
| 2896 | } |
| 2897 | |
| 2898 | fn is_tailscale_ip(ip: IpAddr) -> bool { |
| 2899 | match ip { |
nothing calls this directly
no test coverage detected