wgengine: start network logger in Userspace.Reconfig (#5908)

If the wgcfg.Config is specified with network logging arguments,
then Userspace.Reconfig starts up an asynchronous network logger,
which is shutdown either upon Userspace.Close or when Userspace.Reconfig
is called again without network logging or route arguments.

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
Joe Tsai
2022-10-12 15:05:21 -07:00
committed by GitHub
parent 49bae7fd5c
commit f9120eee57
4 changed files with 63 additions and 11 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ func TestResourceCheck(t *testing.T) {
var l Logger
var d fakeDevice
for i := 0; i < 10; i++ {
must.Do(l.Startup(logtail.PrivateID{}, logtail.PrivateID{}, &d, &router.Config{}))
must.Do(l.Startup(logtail.PrivateID{}, logtail.PrivateID{}, &d))
l.ReconfigRoutes(&router.Config{})
must.Do(l.Shutdown(context.Background()))
c.Assert(d.toggled, qt.Equals, 2*(i+1))