summaryrefslogtreecommitdiffhomepage
path: root/net/netmon
diff options
context:
space:
mode:
Diffstat (limited to 'net/netmon')
-rw-r--r--net/netmon/interfaces_darwin.go5
-rw-r--r--net/netmon/netmon.go1
2 files changed, 6 insertions, 0 deletions
diff --git a/net/netmon/interfaces_darwin.go b/net/netmon/interfaces_darwin.go
index 126040350..757d8697a 100644
--- a/net/netmon/interfaces_darwin.go
+++ b/net/netmon/interfaces_darwin.go
@@ -30,6 +30,11 @@ var ifNames struct {
m map[int]string // ifindex => name
}
+var _ = func() bool {
+ syncs.RegisterMutex(&ifNames.Mutex, "netmon.ifNames.Mutex")
+ return true
+}()
+
func init() {
interfaceDebugExtras = interfaceDebugExtrasDarwin
}
diff --git a/net/netmon/netmon.go b/net/netmon/netmon.go
index 657da04d5..a9b7f756a 100644
--- a/net/netmon/netmon.go
+++ b/net/netmon/netmon.go
@@ -125,6 +125,7 @@ func New(bus *eventbus.Bus, logf logger.Logf) (*Monitor, error) {
stop: make(chan struct{}),
lastWall: wallTime(),
}
+ syncs.RegisterMutex(&m.mu, "netmon.Monitor.mu")
m.changed = eventbus.Publish[ChangeDelta](m.b)
st, err := m.interfaceStateUncached()
if err != nil {