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>
pull/16574/head
Jordan Whited 5 months ago committed by GitHub
parent d65c0fd2d0
commit cb7a0b1dca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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)

Loading…
Cancel
Save