mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-10 08:40:28 +00:00
remove switch doworker loop, start a dummy loop to respond to (unused) reconfiguration instead
This commit is contained in:
parent
998c76fd8c
commit
c573170886
@ -566,7 +566,12 @@ func (t *switchTable) getTable() lookupTable {
|
|||||||
// Starts the switch worker
|
// Starts the switch worker
|
||||||
func (t *switchTable) start() error {
|
func (t *switchTable) start() error {
|
||||||
t.core.log.Infoln("Starting switch")
|
t.core.log.Infoln("Starting switch")
|
||||||
go t.doWorker()
|
go func() {
|
||||||
|
// TODO find a better way to handle reconfiguration... and have the switch do something with the new configuration
|
||||||
|
for ch := range t.reconfigure {
|
||||||
|
ch <- nil
|
||||||
|
}
|
||||||
|
}()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -865,17 +870,6 @@ func (t *switchTable) _idleIn(port switchPort) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The switch worker does routing lookups and sends packets to where they need to be
|
|
||||||
func (t *switchTable) doWorker() {
|
|
||||||
for {
|
|
||||||
//t.core.log.Debugf("Switch state: idle = %d, buffers = %d", len(idle), len(t.queues.bufs))
|
|
||||||
select {
|
|
||||||
case e := <-t.reconfigure:
|
|
||||||
e <- nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Passed a function to call.
|
// Passed a function to call.
|
||||||
// This will send the function to t.admin and block until it finishes.
|
// This will send the function to t.admin and block until it finishes.
|
||||||
func (t *switchTable) doAdmin(f func()) {
|
func (t *switchTable) doAdmin(f func()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user