mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-27 10:47:35 +00:00
magicsock: use [unexpected] convention more
Fixes #136 (not entirely, but we have a convention now)
This commit is contained in:
parent
848a2bddf0
commit
40ebba1373
@ -522,11 +522,11 @@ func (c *Conn) Send(b []byte, ep conn.Endpoint) error {
|
|||||||
var as *AddrSet
|
var as *AddrSet
|
||||||
switch v := ep.(type) {
|
switch v := ep.(type) {
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("unexpected Endpoint type %T", v))
|
panic(fmt.Sprintf("[unexpected] Endpoint type %T", v))
|
||||||
case *singleEndpoint:
|
case *singleEndpoint:
|
||||||
addr := (*net.UDPAddr)(v)
|
addr := (*net.UDPAddr)(v)
|
||||||
if addr.IP.Equal(derpMagicIP) {
|
if addr.IP.Equal(derpMagicIP) {
|
||||||
c.logf("DERP BUG: attempting to send packet to DERP address %v", addr)
|
c.logf("[unexpected] DERP BUG: attempting to send packet to DERP address %v", addr)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
_, err := c.pconn.WriteTo(b, addr)
|
_, err := c.pconn.WriteTo(b, addr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user