net/interfaces: don't try to fork on iOS in likelyHomeRouterIPDarwin
No subprocesses allowed on iOS. Will need to do this differently later.
"go4.org/mem"
"inet.af/netaddr"
"tailscale.com/util/lineread"
+ "tailscale.com/version"
)
func init() {
@@ -32,6 +33,13 @@ func init() {
*/
func likelyHomeRouterIPDarwin() (ret netaddr.IP, ok bool) {
+ if version.IsMobile() {
+ // Don't try to do subprocesses on iOS. Ends up with log spam like:
+ // kernel: "Sandbox: IPNExtension(86580) deny(1) process-fork"
+ // TODO(bradfitz): let our iOS app register a func with this package
+ // and have it call into C/Swift to get the routing table.
+ return ret, false
+ }
cmd := exec.Command("/usr/sbin/netstat", "-r", "-n", "-f", "inet")
stdout, err := cmd.StdoutPipe()
if err != nil {
