mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
device: signal to close device in separate routine
Otherwise we wind up deadlocking. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
c5f382624e
commit
5f0c8b942d
@ -228,7 +228,7 @@ func (device *Device) RoutineReadFromTUN() {
|
||||
if err != nil {
|
||||
if !device.isClosed() {
|
||||
device.log.Errorf("Failed to read packet from TUN device: %v", err)
|
||||
device.Close()
|
||||
go device.Close()
|
||||
}
|
||||
device.PutMessageBuffer(elem.buffer)
|
||||
device.PutOutboundElement(elem)
|
||||
|
Loading…
Reference in New Issue
Block a user