]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
device: handle broader range of errors in RoutineReceiveIncoming
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 30 Mar 2021 19:36:59 +0000 (12:36 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 30 Mar 2021 19:41:43 +0000 (12:41 -0700)
commit6228659a9136014c5a96c2a4f9f5e3678b0d1e08
tree63310c1ab99233a9f1835353709c5402927f2dc2
parent517f0703f515f8cfad2f5887d71ca6fbfbbd4d72
device: handle broader range of errors in RoutineReceiveIncoming

RoutineReceiveIncoming exits immediately on net.ErrClosed,
but not on other errors. However, for errors that are known
to be permanent, such as syscall.EAFNOSUPPORT,
we may as well exit immediately instead of retrying.

This considerably speeds up the package device tests right now,
because the Bind sometimes (incorrectly) returns syscall.EAFNOSUPPORT
instead of net.ErrClosed.

Signed-off-by: Josh Bleecher Snyder <josharian@gmail.com>
device/receive.go