net/udprelay: log socket read errors (#16573)

Socket read errors currently close the server, so we need to understand
when and why they occur.

Updates tailscale/corp#27502
Updates tailscale/corp#30118

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2025-07-15 15:23:47 -07:00
committed by GitHub
parent d65c0fd2d0
commit cb7a0b1dca

View File

@@ -581,6 +581,7 @@ func (s *Server) packetReadLoop(readFromSocket, otherSocket *net.UDPConn) {
// TODO: extract laddr from IP_PKTINFO for use in reply
n, from, err := readFromSocket.ReadFromUDPAddrPort(b)
if err != nil {
s.logf("error reading from socket(%v): %v", readFromSocket.LocalAddr(), err)
return
}
s.handlePacket(from, b[:n], readFromSocket, otherSocket)