Add missing locks and fix debug output, and try to flush queues

Flushing queues on exit is sort of a partial solution, but this could be
better. Really what we want is for no more packets to be enqueued after
isUp is set to false.
This commit is contained in:
Jason A. Donenfeld
2018-05-01 16:59:13 +02:00
parent b34604245e
commit 168ef61a63
5 changed files with 116 additions and 42 deletions

View File

@@ -195,7 +195,7 @@ func (peer *Peer) Start() {
}
device := peer.device
device.log.Debug.Println(peer.String(), ": Starting...")
device.log.Debug.Println(peer.String() + ": Starting...")
// sanity check : these should be 0
@@ -242,7 +242,7 @@ func (peer *Peer) Stop() {
}
device := peer.device
device.log.Debug.Println(peer.String(), ": Stopping...")
device.log.Debug.Println(peer.String() + ": Stopping...")
// stop & wait for ongoing peer routines