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 #1426
Updates tailscale/corp#1289

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/1456/head
Brad Fitzpatrick 3 years ago
parent affd859121
commit b14ea68754

@ -105,6 +105,7 @@ import "C"
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

Loading…
Cancel
Save