From 5a89a869be1f94a16c5dd558d5150d1f8af1ff2d Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sun, 2 Dec 2018 23:24:54 +0000 Subject: [PATCH] Set queueTotalMaxSize before switch worker starts --- src/yggdrasil/core.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/yggdrasil/core.go b/src/yggdrasil/core.go index 224945e0..706b8aa3 100644 --- a/src/yggdrasil/core.go +++ b/src/yggdrasil/core.go @@ -100,17 +100,15 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error { return err } + if nc.SwitchOptions.MaxTotalQueueSize >= SwitchQueueTotalMinSize { + c.switchTable.queueTotalMaxSize = nc.SwitchOptions.MaxTotalQueueSize + } + if err := c.switchTable.start(); err != nil { c.log.Println("Failed to start switch") return err } - if nc.SwitchOptions.MaxTotalQueueSize >= SwitchQueueTotalMinSize { - c.switchTable.doAdmin(func() { - c.switchTable.queueTotalMaxSize = nc.SwitchOptions.MaxTotalQueueSize - }) - } - c.sessions.setSessionFirewallState(nc.SessionFirewall.Enable) c.sessions.setSessionFirewallDefaults( nc.SessionFirewall.AllowFromDirect,