wgengine/magicsock: always run ReceiveIPv6

One of the consequences of the 	bind refactoring in 6f23087175
is that attempting to bind an IPv6 socket will always
result in c.pconn6.pconn being non-nil.
If the bind fails, it'll be set to a placeholder packet conn
that blocks forever.

As a result, we can always run ReceiveIPv6 and health check it.
This removes IPv4/IPv6 asymmetry and also will allow health checks
to detect any IPv6 receive func failures.

Signed-off-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Josh Bleecher Snyder
2021-04-28 10:43:51 -07:00
parent fe50ded95c
commit 9d542e08e2
2 changed files with 6 additions and 9 deletions

View File

@@ -297,10 +297,10 @@ func overallErrorLocked() error {
var (
ReceiveIPv4 = ReceiveFuncStats{name: "ReceiveIPv4"}
// ReceiveIPv6 isn't guaranteed to be running, so skip it for now.
ReceiveIPv6 = ReceiveFuncStats{name: "ReceiveIPv6"}
ReceiveDERP = ReceiveFuncStats{name: "ReceiveDERP"}
receiveFuncs = []*ReceiveFuncStats{&ReceiveIPv4, &ReceiveDERP}
receiveFuncs = []*ReceiveFuncStats{&ReceiveIPv4, &ReceiveIPv6, &ReceiveDERP}
)
// ReceiveFuncStats tracks the calls made to a wireguard-go receive func.