wgengine/magicsock: add debug envknob for injecting an endpoint

For testing. Lee wants to play with 'AWS Global Accelerator Custom
Routing with Amazon Elastic Kubernetes Service'. If this works well
enough, we can promote it.

Updates #12578

Change-Id: I5018347ed46c15c9709910717d27305d0aedf8f4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-07-08 07:21:21 -07:00
committed by Brad Fitzpatrick
parent d2fef01206
commit 42dac7c5c2
4 changed files with 34 additions and 1 deletions

View File

@@ -919,6 +919,12 @@ func (c *Conn) determineEndpoints(ctx context.Context) ([]tailcfg.Endpoint, erro
}
}
// Temporarily (2024-07-08) during investigations, allow setting
// a pretend endpoint for testing NAT traversal scenarios.
// TODO(bradfitz): probably promote this to the config file.
// https://github.com/tailscale/tailscale/issues/12578
addAddr(pretendpoint(), tailcfg.EndpointExplicitConf)
// Update our set of endpoints by adding any endpoints that we
// previously found but haven't expired yet. This also updates the
// cache with the set of endpoints discovered in this function.