mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-03 20:45:24 +00:00

We have two separate functions, SetHostinfo and SetNetInfo, called by different systems at different times. But we store the NetInfo object inside the Hostinfo object. Usually this is fine if we: 1. SetHostinfo 2. SetNetInfo But it is possible to: 1. SetNetInfo -- controlclient now knows about our home DERP 2. SetHostinfo -- NetInfo is now nil The result is controlclient loses track of our PreferredDERP. In our end-to-end test, this appears as the client being connected to a test DERP server, but the server never receiving the information. This is visible in the logs of the end-to-end test by searching for the string "[v1] HostInfo" and seeing that even though a DERP home is well established before the log line, there is no NetInfo to speak of. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>