device: avoid verbose log line during ordinary shutdown sequence

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2021-05-07 09:39:06 +02:00
parent 69b39db0b4
commit efb8818550

View File

@ -94,11 +94,11 @@ func (device *Device) RoutineReceiveIncoming(recv conn.ReceiveFunc) {
size, endpoint, err = recv(buffer[:])
if err != nil {
device.log.Verbosef("Routine: receive incoming %s - failed to receive packet: %v", recvName, err)
device.PutMessageBuffer(buffer)
if errors.Is(err, net.ErrClosed) {
return
}
device.log.Verbosef("Routine: receive incoming %s - failed to receive packet: %v", recvName, err)
if neterr, ok := err.(net.Error); ok && !neterr.Temporary() {
return
}