mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
net/netmon: publish events to event bus
Updates #15160 Signed-off-by: David Anderson <dave@tailscale.com>
This commit is contained in:

committed by
M. J. Fromberger

parent
6d6f69e735
commit
5399fa159a
@@ -27,6 +27,7 @@ import (
|
||||
"tailscale.com/net/tsaddr"
|
||||
"tailscale.com/tstest"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/eventbus"
|
||||
"tailscale.com/util/linuxfw"
|
||||
"tailscale.com/version/distro"
|
||||
)
|
||||
@@ -363,7 +364,9 @@ ip route add throw 192.168.0.0/24 table 52` + basic,
|
||||
},
|
||||
}
|
||||
|
||||
mon, err := netmon.New(logger.Discard)
|
||||
bus := eventbus.New()
|
||||
defer bus.Close()
|
||||
mon, err := netmon.New(bus, logger.Discard)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -973,7 +976,10 @@ func newLinuxRootTest(t *testing.T) *linuxTest {
|
||||
|
||||
logf := lt.logOutput.Logf
|
||||
|
||||
mon, err := netmon.New(logger.Discard)
|
||||
bus := eventbus.New()
|
||||
defer bus.Close()
|
||||
|
||||
mon, err := netmon.New(bus, logger.Discard)
|
||||
if err != nil {
|
||||
lt.Close()
|
||||
t.Fatal(err)
|
||||
|
Reference in New Issue
Block a user