aboutsummaryrefslogtreecommitdiffstats
path: root/device/peer.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-02-10 00:39:28 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-10 00:39:28 +0100
commit484a9fd32494176526e0ffe81413e73362a6f92d (patch)
tree96bfde8f3f0f94e8d84ca9e811b01215df754dca /device/peer.go
parentdevice: create peer queues at peer creation time (diff)
downloadwireguard-go-484a9fd32494176526e0ffe81413e73362a6f92d.tar.xz
wireguard-go-484a9fd32494176526e0ffe81413e73362a6f92d.zip
device: flush peer queues before starting device
In case some old packets snuck in there before, this flushes before starting afresh. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/peer.go')
-rw-r--r--device/peer.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/device/peer.go b/device/peer.go
index 40de59b..a3b428a 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -186,6 +186,8 @@ func (peer *Peer) Start() {
peer.timersStart()
+ device.flushInboundQueue(peer.queue.inbound)
+ device.flushOutboundQueue(peer.queue.outbound)
go peer.RoutineSequentialSender()
go peer.RoutineSequentialReceiver()