net/interfaces: log why when we failed to look up gateway on macOS
Not beautiful, but I'm debugging connectivity problems on
NEProvider.sleep+wake and need more clues.
Updates
Updates tailscale/corp#1289
import (
"encoding/binary"
+ "log"
"inet.af/netaddr"
)
@@ -116,6 +117,7 @@ func init() {
func likelyHomeRouterIPDarwinSyscall() (ret netaddr.IP, ok bool) {
ip := C.privateGatewayIP()
if ip < 255 {
+ log.Printf("likelyHomeRouterIPDarwinSyscall: error code %v", ip)
return netaddr.IP{}, false
}
var q [4]byte
