device: tie encryption queue lifetime to the peers that write to it

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2021-02-02 10:46:34 -08:00
committed by Jason A. Donenfeld
parent 4846070322
commit 8a374a35a0
3 changed files with 6 additions and 4 deletions

View File

@@ -291,8 +291,6 @@ func (peer *Peer) StagePacket(elem *QueueOutboundElement) {
}
func (peer *Peer) SendStagedPackets() {
peer.device.queue.encryption.wg.Add(1)
defer peer.device.queue.encryption.wg.Done()
top:
if len(peer.queue.staged) == 0 || !peer.device.isUp.Get() {
return