summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-01-19api.md: add TOCbradfitz/api_docsBrad Fitzpatrick1-6/+56
2021-01-18tailcfg: remove v6-overlay debug option.David Anderson1-2/+0
It's about to become a no-op in control. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-18wgengine/magicsock: simplify ReceiveIPv4+DERP pathBrad Fitzpatrick2-186/+151
name old time/op new time/op delta ReceiveFrom-4 35.8µs ± 3% 21.9µs ± 5% -38.92% (p=0.008 n=5+5) Fixes #1145 Updates #414 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-18wgengine: correctly track all node IPs in lazy config.David Anderson1-3/+6
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-15wgengine/magicsock: use relatively new netaddr.IPPort.IsZero methodBrad Fitzpatrick1-1/+1
2021-01-15wgengine/magicsock: speed up BenchmarkReceiveFrom, store context.Done chanBrad Fitzpatrick1-9/+9
context.cancelCtx.Done involves a mutex and isn't as cheap as I previously assumed. Convert the donec method into a struct field and store the channel value once. Our one magicsock.Conn gets one pointer larger, but it cuts ~1% of the CPU time of the ReceiveFrom benchmark and removes a bubble from the --svg output :)
2021-01-15go.sum: update (forgotten after earlier wireguard-go update again)Brad Fitzpatrick1-0/+2
2021-01-15logtail: add testsDenton Gentry1-14/+242
+ add a test for parseAndRemoveLogLevel() + add a test for drainPendingMessages() + test JSON log encoding including several special cases Other tests frequently send logs but a) don't check the result and b) do so by happenstance, such that the code in encode() was not consistently being exercised and leading to spurious changes in code coverage. These tests attempt to more systematically test the logging function. This is the second attempt to add these tests, the first attempt (in https://github.com/tailscale/tailscale/pull/1114) had two issues: 1. httptest.NewServer creates multiple goroutine handlers, and logtail uses goroutines to upload, but the first version had no locking in the server to guard this. Moved data handling into channels to get synchronization. 2. The channel to notify the test of the arrival of data had a depth of 1, in cases where the Logger sent multiple uploads it would block the server. This resulted in the first iteration of these tests being flaky, and we reverted it. This new version of the tests has passed with go test -race -count=10000 and seems solid. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-15tstun: add test to send a packet after Close()Denton Gentry1-0/+16
This test serves two purposes: + check that Write() returns an error if the tstun has been closed. + ensure that the close-related code in tstun is exercised in a test case. We were getting spurious code coverage adds/drops based on timing of when the test case finished. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-15net/nettest: de-flake tests on WindowsJosh Bleecher Snyder1-2/+2
Windows has a low resolution timer. Some of the tests assumed that unblock takes effect immediately. Consider: t := time.Now() elapsed := time.Now().After(t) It seems plausible that elapsed should always be true. However, with a low resolution timer, that might fail. Change time.Now().After to !time.Now().Before, so that unblocking always takes effect immediately. Fixes #873.
2021-01-15net/nettest: remove pointless checks in testsJosh Bleecher Snyder1-5/+4
If err == nil, then !errors.Is(err, anything).
2021-01-15net/nettest: add missing check at end of TestLimitJosh Bleecher Snyder1-0/+4
This appears to have been an oversight.
2021-01-15wgengine/magicsock: prevent logging after TestActiveDiscovery completesJosh Bleecher Snyder1-1/+3
2021-01-15go.mod: bump to pull in minor wireguard-go changesJosh Bleecher Snyder1-1/+1
2021-01-15wgengine/magicsock: adapt to wireguard-go without UpdateDstJosh Bleecher Snyder4-44/+16
22507adf5489a8293e03a5af06bd6af41d031468 stopped relying on our fork of wireguard-go's UpdateDst callback. As a result, we can unwind that code, and the extra return value of ReceiveIPv{4,6}. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-15magicksock: remove TestConnClosing. (#1140)Denton Gentry1-88/+0
Test is flakey, remove it and figure out what to do differently later. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-15wgengine/magicsock: disable legacy networking everywhere except TwoDevicePing.David Anderson1-8/+9
TwoDevicePing is explicitly testing the behavior of the legacy codepath, everything else is happy to assume that code no longer exists. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-15wgengine/magicsock: disable legacy behavior in a few more tests.David Anderson1-6/+9
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-15wgengine/magicsock: default legacy networking to off for some tests.David Anderson1-0/+2
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-15wgengine/magicsock: add an option to disable legacy peer handling.David Anderson3-2/+26
Used in tests to ensure we're not relying on behavior we're going to remove eventually. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-15wgengine/magicsock: fix BenchmarkReceiveFrom.David Anderson2-1/+25
Previously, this benchmark relied on behavior of the legacy receive codepath, which I changed in 22507adf. With this change, the benchmark instead relies on the new active discovery path. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-15wgengine/magicsock: close test loggers once we're done with themJosh Bleecher Snyder2-8/+38
This is a big hammer approach to helping with #1132. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-15wgengine/magicsock: shortcircuit discoEndpoint.heartbeat when its connection ↵Josh Bleecher Snyder1-0/+11
is closed This prevents us from continuing to do unnecessary work (including logging) after the connection has closed. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-15wgengine/magicsock: simplifyJosh Bleecher Snyder1-2/+1
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-15wgengine/magicsock: quiet wireguard-go logging in testsJosh Bleecher Snyder1-15/+19
We already do this in newUserspaceEngineAdvanced. Apply it to newMagicStack as well. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-15wgengine/userspace: make wireguard-go log silencing include peer routinesJosh Bleecher Snyder1-1/+1
Also suppress log lines like: peer(Kksd…ySmc) - Routine: sequential sender - stopped Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-15net/packet, wgengine, tstun: add inter-node TSMP protocol for connect errorsBrad Fitzpatrick10-41/+362
This adds a new IP Protocol type, TSMP on protocol number 99 for sending inter-tailscale messages over WireGuard, currently just for why a peer rejects TCP SYNs (ACL rejection, shields up, and in the future: nothing listening, something listening on that port but wrong interface, etc) Updates #1094 Updates tailscale/corp#1185 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-15go.mod: bump wireguard-go version.David Anderson1-1/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-15ipn, ipnserver: only require sudo on Linux for mutable CLI actionsBrad Fitzpatrick6-27/+161
This partially reverts d6e9fb1df0fd6, which modified the permissions on the tailscaled Unix socket and thus required "sudo tailscale" even for "tailscale status". Instead, open the permissions back up (on Linux only) but have the server look at the peer creds and only permit read-only actions unless you're root. In the future we'll also have a group that can do mutable actions. On OpenBSD and FreeBSD, the permissions on the socket remain locked down to 0600 from d6e9fb1df0fd6. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-15cmd/tailscale/cli: tweak the status name column a bitBrad Fitzpatrick1-2/+2
* make peers without DNS names show their hostnames as always one column, for cut/etc users * remove trailing dot from shared peers' DNS names
2021-01-15wgengine/netstack: use tailscale IPs instead of a hardcoded one (#1131)Naman Sood4-10/+95
Signed-off-by: Naman Sood <mail@nsood.in>
2021-01-14go.sum: updateBrad Fitzpatrick1-0/+2
2021-01-14wgengine/tsdns: fix MagicDNS lookups of shared nodesBrad Fitzpatrick1-4/+3
Fixes tailscale/corp#1184
2021-01-14go.sum: updateBrad Fitzpatrick1-0/+2
2021-01-14wgengine/router/dns: remove unused codeAlex Brainman1-6/+0
Commit 68ddf1 removed code that reads `SOFTWARE\Tailscale IPN\SearchList` registry value. But the commit left code that writes that value. So now this package writes and never reads the value. Remove the code to stop pointless work. Updates #853 Signed-off-by: Alex Brainman <alex.brainman@gmail.com>
2021-01-14all: convert from []wgcfg.Endpoint to stringJosh Bleecher Snyder11-64/+52
This eliminates a dependency on wgcfg.Endpoint, as part of the effort to eliminate our wireguard-go fork. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-14wgengine/magicsock: import more of wireguard-go, update docstrings.David Anderson3-14/+89
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-14wgengine/magicsock: stop depending on UpdateDst in legacy codepaths.David Anderson6-62/+155
This makes connectivity between ancient and new tailscale nodes slightly worse in some cases, but only in cases where the ancient version would likely have failed to get connectivity anyway. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-14tsweb: export VarzHandlerBrad Fitzpatrick1-3/+3
2021-01-13control/controlclient: let clients opt in to Sharer-vs-User split modelBrad Fitzpatrick1-33/+32
Updates tailscale/corp#1183
2021-01-13go.mod: update to latest wireguard-goJosh Bleecher Snyder1-1/+1
2021-01-13wgengine: adapt to removal of wgcfg.Key in wireguard-goJosh Bleecher Snyder1-5/+6
2021-01-13Provide example when format string is rate limitedSmitty2-3/+3
Here's an example log line in the new format: [RATE LIMITED] format string "open-conn-track: timeout opening %v; no associated peer node" (example: "open-conn-track: timeout opening ([ip] => [ip]); no associated peer node") This should make debugging logging issues a bit easier, and give more context as to why something was rate limited. This change was proposed in a comment on #1110. Signed-off-by: Smitty <me@smitop.com>
2021-01-12Revert "Add logtail tests (#1114)" (#1116)Denton Gentry1-209/+7
This reverts commit e4f53e9b6f1a4d3d6f00091ddef617989b1ea3e4. At least two of these tests are flakey, reverting until they can be made more robust. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12wgengine/tsdns: return NOERROR instead of NOTIMP for most recordsSmitty2-1/+19
This is what every other DNS resolver I could find does, so tsdns should do it to. This also helps avoid weird error messages about non-existent records being unimplemented, and thus fixes #848. Signed-off-by: Smitty <me@smitop.com>
2021-01-12Add logtail tests (#1114)Denton Gentry1-7/+209
* logtail: test parseAndRemoveLogLevel() Signed-off-by: Denton Gentry <dgentry@tailscale.com> * logtail: test JSON log encoding. Expand TestUploadMessages to also exercise the encoding functions in logtail, like JSON logging and timestamps. Other tests frequently send logs but a) don't check the result and b) do so by happenstance, such that the lines in encode() were not consistently being exercised and leading to spurious changes in code coverage. Signed-off-by: Denton Gentry <dgentry@tailscale.com> * logtail: add a test for drainPendingMessages Make the client buffer some messages before the upload server becomes available. Signed-off-by: Denton Gentry <dgentry@tailscale.com> * logtail: use %q, raw strings, and io.WriteString %q escapes binary characters for us. raw strings avoid so much backslash escaping Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12control/controlclient: treat node sharer as owner for display purposesBrad Fitzpatrick1-0/+14
This make clients (macOS, Windows, tailscale status) show the node sharer's profile rather than the node owner (which may be anonymized). Updates #992
2021-01-12README: names of contributors, link to them insteadBrad Fitzpatrick1-3/+8
2021-01-12tailcfg, control/controlclient: make MapResponse.CollectServices an opt.BoolBrad Fitzpatrick2-2/+9
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-12API.md: add documentation for deleting a deviceChristina Wen1-9/+45
Signed-off-by: Christina Wen <christina@tailscale.com>