diff --git a/src/yggdrasil/core.go b/src/yggdrasil/core.go index 224945e..706b8aa 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,