mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
wgengine/magicsock: reduce log spam during tests
Only do the type assertion to *net.UDPAddr when addr is non-nil. This prevents a bunch of log spam during tests.
This commit is contained in:
parent
88586ec4a4
commit
1632f9fd6b
@ -2775,12 +2775,13 @@ func (c *RebindingUDPConn) ReadFromNetaddr(b []byte) (n int, ipp netaddr.IPPort,
|
|||||||
} else {
|
} else {
|
||||||
var addr net.Addr
|
var addr net.Addr
|
||||||
n, addr, err = pconn.ReadFrom(b)
|
n, addr, err = pconn.ReadFrom(b)
|
||||||
var ok2 bool
|
if addr != nil {
|
||||||
pAddr, ok2 = addr.(*net.UDPAddr)
|
pAddr, ok = addr.(*net.UDPAddr)
|
||||||
if !ok2 {
|
if !ok {
|
||||||
return 0, netaddr.IPPort{}, fmt.Errorf("RebindingUDPConn.ReadFromNetaddr: underlying connection returned address of type %T, want *netaddr.UDPAddr", addr)
|
return 0, netaddr.IPPort{}, fmt.Errorf("RebindingUDPConn.ReadFromNetaddr: underlying connection returned address of type %T, want *netaddr.UDPAddr", addr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user