diff --git a/net/interfaces/interfaces_darwin.go b/net/interfaces/interfaces_darwin.go index c502255a9..08705a8a7 100644 --- a/net/interfaces/interfaces_darwin.go +++ b/net/interfaces/interfaces_darwin.go @@ -6,6 +6,9 @@ import ( "errors" + "fmt" + "io" + "os" "os/exec" "go4.org/mem" @@ -46,8 +49,10 @@ func likelyHomeRouterIPDarwinExec() (ret netaddr.IP, ok bool) { } defer cmd.Wait() + fmt.Println("netstat output:") + tee := io.TeeReader(stdout, os.Stdout) var f []mem.RO - lineread.Reader(stdout, func(lineb []byte) error { + lineread.Reader(tee, func(lineb []byte) error { line := mem.B(lineb) if !mem.Contains(line, mem.S("default")) { return nil diff --git a/net/interfaces/interfaces_darwin_cgo.go b/net/interfaces/interfaces_darwin_cgo.go index ad9e982c9..77d9b5801 100644 --- a/net/interfaces/interfaces_darwin_cgo.go +++ b/net/interfaces/interfaces_darwin_cgo.go @@ -105,6 +105,7 @@ import ( "encoding/binary" + "fmt" "inet.af/netaddr" ) @@ -116,6 +117,7 @@ func init() { func likelyHomeRouterIPDarwinSyscall() (ret netaddr.IP, ok bool) { ip := C.privateGatewayIP() if ip < 255 { + fmt.Println("privateGatewayIP failure:", ip) return netaddr.IP{}, false } var q [4]byte