diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2025-09-12 14:23:12 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@tailscale.com> | 2025-09-12 14:23:12 -0700 |
| commit | 032d425a413fa92028705c3ce8314ff3a61ca168 (patch) | |
| tree | 51b55dff963677bc5f5bda5899081e1c3b9088b2 /net/netmon/netmon.go | |
| parent | 0cc1b2ff76560ee4675909272fa37ba6b397744c (diff) | |
| download | tailscale-bradfitz/ios_ish.tar.xz tailscale-bradfitz/ios_ish.zip | |
Change-Id: I242111289aeb0c9a0ff843d698bc26168e336165
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'net/netmon/netmon.go')
| -rw-r--r-- | net/netmon/netmon.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/netmon/netmon.go b/net/netmon/netmon.go index b97b184d4..32d9b34a0 100644 --- a/net/netmon/netmon.go +++ b/net/netmon/netmon.go @@ -9,6 +9,7 @@ package netmon import ( "encoding/json" "errors" + "fmt" "net/netip" "runtime" "sync" @@ -18,6 +19,7 @@ import ( "tailscale.com/util/clientmetric" "tailscale.com/util/eventbus" "tailscale.com/util/set" + "tailscale.com/version/distro" ) // pollWallTimeInterval is how often we check the time to check @@ -118,6 +120,9 @@ type ChangeDelta struct { // The returned monitor is inactive until it's started by the Start method. // Use RegisterChangeCallback to get notified of network changes. func New(bus *eventbus.Bus, logf logger.Logf) (*Monitor, error) { + if distro.Get() == distro.ISH { + return NewStatic(), nil // netlink doesn't work in iSH + } logf = logger.WithPrefix(logf, "monitor: ") m := &Monitor{ logf: logf, @@ -129,7 +134,7 @@ func New(bus *eventbus.Bus, logf logger.Logf) (*Monitor, error) { m.changed = eventbus.Publish[*ChangeDelta](m.b) st, err := m.interfaceStateUncached() if err != nil { - return nil, err + return nil, fmt.Errorf("interface state: %w", err) } m.ifState = st |
