wgengine/magicsock: log when a ReceiveFunc fails

Updates #10976

Change-Id: I86d30151a25c7d42ed36e273fb207873f4acfdb4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-08-14 10:28:39 -07:00
committed by Brad Fitzpatrick
parent 74b9fa1348
commit 2dd71e64ac
2 changed files with 26 additions and 4 deletions

View File

@@ -1274,10 +1274,15 @@ func (c *Conn) mkReceiveFunc(ruc *RebindingUDPConn, healthItem *health.ReceiveFu
// epCache caches an IPPort->endpoint for hot flows.
var epCache ippEndpointCache
return func(buffs [][]byte, sizes []int, eps []conn.Endpoint) (int, error) {
return func(buffs [][]byte, sizes []int, eps []conn.Endpoint) (_ int, retErr error) {
if healthItem != nil {
healthItem.Enter()
defer healthItem.Exit()
defer func() {
if retErr != nil {
c.logf("Receive func %s exiting with error: %T, %v", healthItem.Name(), retErr, retErr)
}
}()
}
if ruc == nil {
panic("nil RebindingUDPConn")