summaryrefslogtreecommitdiffhomepage
path: root/control
AgeCommit message (Collapse)AuthorFilesLines
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.
2020-05-03types/structs: add structs.Incomparable annotation, use it where applicableBrad Fitzpatrick3-1/+8
Shotizam before and output queries: sqlite> select sum(size) from bin where func like 'type..%'; 129067 => 120216
2020-05-01controlclient, ipn: adjust tests for tailscale.com keepalive changeDavid Crawshaw1-15/+20
2020-04-30Appease the "missing copyright header" check.Avery Pennarun1-0/+4
Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-04-30wgengine/filter: support subnet mask rules, not just /32 IPs.Avery Pennarun2-1/+81
This depends on improved support from the control server, to send the new subnet width (Bits) fields. If these are missing, we fall back to assuming their value is /32. Conversely, if the server sends Bits fields to an older client, it will interpret them as /32 addresses. Since the only rules we allow are "accept" rules, this will be narrower or equal to the intended rule, so older clients will simply reject hosts on the wider subnet (fail closed). With this change, the internal filter.Matches format has diverged from the wire format used by controlclient, so move the wire format into tailcfg and convert it to filter.Matches in controlclient. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-04-28tstest: rename from testy.David Anderson1-5/+5
Signed-off-by: David Anderson <danderson@tailscale.com>
2020-04-29ipn, controlclient: add control.New parameterDavid Crawshaw2-3/+3
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-04-27control/controlclient: wait for c1 to receive a netmap.David Anderson1-2/+11
This strictly sequences things such that c1 is fully registered in the control server before c2 creates its poll. Failure to do this can cause an inversion where c2's poll finishes establishing before c1's poll starts, which results in c2 getting disconnected rather than c1, and the test times out waiting for c1 to get kicked. Fixes #98. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-04-27control/controlclient: document test TestClientsReusingKeys.David Anderson2-9/+37
The test is straightforward, but it's a little perplexing if you're not overly familiar with controlclient. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-04-27control/controlclient: fix build break caused by overzealous gittingBrad Fitzpatrick1-0/+5
2020-04-27Revert "net/tlsdial: add memory-optimized TLS cert verification path for iOS"Brad Fitzpatrick1-5/+0
This reverts commit 6fcbd4c4d476bd461c9bd2e52df6e3b7964a6452. Decided to put it in tailscale/go's crypto/x509 instead.
2020-04-26control/controlclient: also rename HTTPC in the testsBrad Fitzpatrick2-9/+9