summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient
AgeCommit message (Collapse)AuthorFilesLines
2020-08-09control/controlclient: use less battery when stopped, stop map requestsBrad Fitzpatrick1-9/+66
Updates #604 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-08-09backoff: update to Go style, document a bit, make 30s explicitBrad Fitzpatrick1-2/+2
Also, bit of behavior change: on non-nil err but expired context, don't reset the consecutive failure count. I don't think the old behavior was intentional. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-08-07tailcfg, control/controlclient: support delta-encoded netmapsBrad Fitzpatrick2-0/+195
Should greatly reduce bandwidth for large networks (including our hello.ipn.dev node). Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-08-06control/controlclient: reset timeout timer on non-keepalive map updatesBrad Fitzpatrick1-9/+11
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-08-06control/controlclient: remove unused NetworkMap.UAPI methodBrad Fitzpatrick1-15/+0
And remove last remaining use of wgcfg.ToUAPI in a test's debug output; replace it with JSON.
2020-08-03control/controlclient: print disco keys NetworkMap diffs (debug change only)Brad Fitzpatrick2-2/+76
NetworkMap text diffs being empty were currently used to short-circuit calling magicsock's SetNetworkMap (via Engine.SetNetworkMap), but that went away in c7582dc2 (0.100.0-230) Prior to c7582dc2 (notably, in 0.100.0-225 and below, down to 0.100.0), a change in only disco key (as when a node restarts) but without endpoint changes (as would happen for a client not behind a NAT with random ports) could result in a "netmap diff: (none)" being printed, as well as Engine.SetNetworkMap being skipped, leading to broken discovery endpoints. c7582dc2 fixed the Engine.SetNetworkMap skippage. This change fixes the "netmap diff: (none)" print so we'll actually see when a peer restarts with identical endpoints but a new discovery key.
2020-07-31all: dns refactor, add Proxied and PerDomain flags from control (#615)Dmytro Shynkevych2-8/+28
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-28ipn: fix netmap change tracking and dns map generation (#609)Dmytro Shynkevych3-3/+28
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-28control/controlclient: remove an 'unexpected' log that no longer isBrad Fitzpatrick1-1/+1
Fixes #611
2020-07-27control/controlclient: populate OSVersion on WindowsBrad Fitzpatrick1-0/+26
2020-07-27tailcfg, control/controlclient: add GoArch, populate OSVersion on LinuxBrad Fitzpatrick3-0/+103
2020-07-25control/controlclient: remove unused, slow, often-not-what-you-want ↵Brad Fitzpatrick1-21/+0
NetworkMap.Equal
2020-07-23control/controlclient: rewrite, test NetworkMap.ConciseDiffFromBrad Fitzpatrick2-63/+300
It stood out a lot in hello.ipn.dev's profiles for generating a lot of garbage (and thus GC CPU).
2020-07-23control/controlclient: rename uflags, give it a type, remove dead codeBrad Fitzpatrick1-29/+15
2020-07-23control/controlclient: generate wireguard config w/o WgQuick text indirectionBrad Fitzpatrick1-66/+53
2020-07-15control/controlclient: eliminate race in loginGoal access.Dmytro Shynkevych1-4/+5
This code is currently racy due to an incorrect assumption that goal is never modified in-place, so does not require extra locking. This change makes the assumption correct. Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-09control/controlclient: fix a couple more data racesBrad Fitzpatrick1-1/+3
2020-07-08ipn, control/controlclient: fix some data racesBrad Fitzpatrick1-1/+1
More remain. Fixes tailscale/corp#432
2020-07-03control/controlclient, tailcfg: turn active route discovery on by defaultBrad Fitzpatrick1-15/+22
Updates #483
2020-07-02control/controlclient: fix copy/paste-o in debug knob accessorBrad Fitzpatrick1-1/+1
Introduced in a975e86bb8a42f0be9faf16067ee55a6da55d767. Only affected TS_DEBUG_* env users.
2020-07-02control/controlclient: don't truncate AuthURL in logBrad Fitzpatrick1-1/+1
It's useful to copy/paste directly from there, without using tailscale up. If it's truncated for some specific reason, it doesn't say why.
2020-06-29wgengine/magicsock: add new endpoint type used for discovery-supporting peersBrad Fitzpatrick2-21/+72
This adds a new magicsock endpoint type only used when both sides support discovery (that is, are advertising a discovery key). Otherwise the old code is used. So far the new code only communicates over DERP as proof that the new code paths are wired up. None of the actually discovery messaging is implemented yet. Support for discovery (generating and advertising a key) are still behind an environment variable for now. Updates #483
2020-06-29control/controlclient: remove IPv6 opt-out environment variableBrad Fitzpatrick1-12/+1
It was temporary and 3 months has elapsed without problems.
2020-06-25control/controlclient: add Debug field to NetworkMapBrad Fitzpatrick3-21/+69
As part of disabling background STUN packets when idle, we want an emergency override switch to turn it back on, in case it interacts poorly in the wild. We'll send that via control, but we'll want to plumb it down to magicsock via NetworkMap. Updates tailscale/corp#320 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-06-24control/controlclient: cut down some NetworkMap stringification & diff ↵Brad Fitzpatrick2-3/+45
allocations And start of tests.
2020-06-24control/controlclient: trim /32 suffix a bit more succinctlyBrad Fitzpatrick1-4/+1
2020-06-19all: generate discovery key, plumb it aroundBrad Fitzpatrick1-0/+4
Not actually used yet. Updates #483
2020-06-18control/controlclient: make netmap generation use rate-limited logger.David Anderson1-8/+9
2020-06-18control/controlclient: delete unused function.David Anderson1-8/+0
2020-06-15Fix concurrency issues in controlclient, ipn, types/logger (#456)Dmytro Shynkevych1-6/+10
Signed-Off-By: Dmytro Shynkevych <dmytro@tailscale.com>
2020-06-12log/logheap: change to POST to a URL instead of loggingBrad Fitzpatrick1-1/+1
It's too big to log.
2020-06-01net/netns: move SOCKS dialing to netns for nowBrad Fitzpatrick1-1/+1
This lets control & logs also use SOCKS dials. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-05-29control/controlclient: use netns package to dial connections.David Anderson1-0/+3
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-05-28Revert "control/controlclient: use "getprop net.hostname" for Android hostname"Brad Fitzpatrick1-23/+1
This reverts commit afb9c6a6abc9fa5a26200cc36d1ffc947b8b9e89. Doesn't work. See: https://github.com/tailscale/tailscale/issues/409#issuecomment-635241550 Looks pretty dire: https://medium.com/capital-one-tech/how-to-get-an-android-device-nickname-d5eab12f4ced Updates #409
2020-05-27control/controlclient: use "getprop net.hostname" for Android hostnameBrad Fitzpatrick1-1/+23
Updates #409
2020-05-27control/controlclient: move auto_test back to corp repo.David Anderson3-1373/+69
It can't run without corp stuff anyway, and makes it harder to refactor the control server.
2020-05-27control/controlclient: move direct_test back to corp repo.David Anderson1-384/+0
It can only be built with corp deps anyway, and having it split from the control code makes our lives harder. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-05-25tailcfg: add MapResponse.Debug mechanism to trigger logging heap pprofBrad Fitzpatrick1-0/+4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-05-23all: make client use server-provided DERP map, add DERP region supportBrad Fitzpatrick2-0/+12
Instead of hard-coding the DERP map (except for cmd/tailscale netcheck for now), get it from the control server at runtime. And make the DERP map support multiple nodes per region with clients picking the first one that's available. (The server will balance the order presented to clients for load balancing) This deletes the stunner package, merging it into the netcheck package instead, to minimize all the config hooks that would've been required. Also fix some test flakes & races. Fixes #387 (Don't hard-code the DERP map) Updates #388 (Add DERP region support) Fixes #399 (wgengine: flaky tests) Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-05-20controlclient tests: fix more memory leaks and add resource checking.Avery Pennarun3-11/+34
I can now run these tests with -count=1000 without running out of RAM. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-19controlclient/direct: fix a race condition accessing auth keys.Avery Pennarun2-1/+7
Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-19controlclient/auto_test: don't print the s.control object.Avery Pennarun1-1/+1
This contains atomic ints that trigger a race check error if we access them non-atomically. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-14controlclient/auto_test: fix flake "peer OS is not linux" on macOS.Avery Pennarun1-0/+10
We were mis-counting the number of Synchronized messages that we should have been generating.
2020-05-14control/controlclient/auto_test: clean up logging to defeat 'go test' idiocy.Avery Pennarun1-144/+168
By default, nothing differentiates errors or fatals from regular logs, so they just blend into the rest of the logs. As a bonus, if you run a test using t.Run(), the log messages printed via the sub-t.Run() are printed at a different time from log messages printed via the parent t.Run(), making debugging almost impossible. This doesn't actually fix the test flake I'm looking for, but at least I can find it in the logs now. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-14control/controlclient: fix a very rare httptest.Server log.Printf.Avery Pennarun1-0/+3
Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-13Add tstest.PanicOnLog(), and fix various problems detected by this.Avery Pennarun2-4/+7
If a test calls log.Printf, 'go test' horrifyingly rearranges the output to no longer be in chronological order, which makes debugging virtually impossible. Let's stop that from happening by making log.Printf panic if called from any module, no matter how deep, during tests. This required us to change the default error handler in at least one http.Server, as well as plumbing a bunch of logf functions around, especially in magicsock and wgengine, but also in logtail and backoff. To add insult to injury, 'go test' also rearranges the output when a parent test has multiple sub-tests (all the sub-test's t.Logf is always printed after all the parent tests t.Logf), so we need to screw around with a special Logf that can point at the "current" t (current_t.Logf) in some places. Probably our entire way of using subtests is wrong, since 'go test' would probably like to run them all in parallel if you called t.Parallel(), but it definitely can't because the're all manipulating the shared state created by the parent test. They should probably all be separate toplevel tests instead, with common setup/teardown logic. But that's a job for another time. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-13{ipn,control/controlclient}/tests: pass a logf function to control.New().Avery Pennarun2-3/+3
This matches the new API requirements. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-05control/controlclient: revert extreneous synchronization.Dmytro Shynkevych1-1/+0
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-05-05control/controlclient: synchronize hostinfo test.Dmytro Shynkevych1-3/+4
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-05-05controlclient and ipn tests: supply --advertise-tags and --advertise-routes.Avery Pennarun1-0/+17
This helps validate the server's behaviour when these are present.