tailscale/control
David Crawshaw b462954c20 controlclient: preserve NetInfo on Hostinfo update
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>
2022-06-16 16:44:50 +10:00
..
controlbase control/controlbase: don't enforce a max protocol version at handshake time. 2022-04-07 17:55:29 -07:00
controlclient controlclient: preserve NetInfo on Hostinfo update 2022-06-16 16:44:50 +10:00
controlhttp control/controlhttp: use secure WebSockets protocol by default 2022-06-08 15:29:21 -07:00
controlknobs envknob: add new package for all the strconv.ParseBool(os.Getenv(..)) 2022-01-24 11:51:23 -08:00