mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-12 13:48:01 +00:00
wgengine/magicsock, derp, derp/derphttp: respond to DERP server->client pings
No server support yet, but we want Tailscale 1.6 clients to be able to respond to them when the server can do it. Updates #1310 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
66480755c2
commit
79d8288f0a
@@ -1465,6 +1465,15 @@ func (c *Conn) runDerpReader(ctx context.Context, derpFakeAddr netaddr.IPPort, d
|
||||
peerPresent[m.Source] = true
|
||||
c.addDerpPeerRoute(m.Source, regionID, dc)
|
||||
}
|
||||
case derp.PingMessage:
|
||||
// Best effort reply to the ping.
|
||||
pingData := [8]byte(m)
|
||||
go func() {
|
||||
if err := dc.SendPong(pingData); err != nil {
|
||||
c.logf("magicsock: derp-%d SendPong error: %v", regionID, err)
|
||||
}
|
||||
}()
|
||||
continue
|
||||
default:
|
||||
// Ignore.
|
||||
continue
|
||||
|
Reference in New Issue
Block a user