summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-01-14net/interfaces: add debugging code for crawshawjosh/debug-TestLikelyHomeRouterIPSyscallExecJosh Bleecher Snyder2-1/+8
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>
2021-01-12API.md: rename "domain" to "tailnet"Christina Wen1-56/+83
Signed-off-by: Christina Wen <christina@tailscale.com>
2021-01-12netcheck: use reflect in sortRegions test.Denton Gentry1-6/+8
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12netcheck: test sortRegionsDenton Gentry1-0/+36
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12magicsock: add description of testClosingContextDenton Gentry1-0/+5
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12logtail: start a local server for TestFastShutdownDenton Gentry1-1/+6
Right now TestFastShutdown tries to upload logs to localhost:1234, which will most likely respond with an error. However if one has an actual service running on port 1234, it would receive a connection attempting to POST every time the unit test runs. Start a local server and direct the upload there instead. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12magicsock: test error case in sendDiscoMessageDenton Gentry1-0/+52
In sendDiscoMessage there is a check of whether the connection is closed, which is not being reliably exercised by other tests. This shows up in code coverage reports, the lines of code in sendDiscoMessage are alternately added and subtracted from code coverage. Add a test to specifically exercise and verify this code path. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12logtail: add a test to upload logs to local serverDenton Gentry1-0/+23
Start an HTTP server to accept POST requests, and upload some logs to it. Check that uploaded logs were received. Code in logtail:drainPending was not being reliably exercised by other tests. This shows up in code coverage reports, as lines of code in drainPending are alternately added and subtracted from code coverage. This test will reliably exercise and verify this code. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12portlist: add a test for SameInodesDenton Gentry1-0/+53
Exercise all cases. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12portlist: fully exercise lessThan in testsDenton Gentry1-0/+94
All cases in lessThan are not reliably exercised by other tests. This shows up in code coverage metrics as lines in lessThan are alternately added and removed from coverage. Add a test case to systematically test all conditions. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-12magicsock: test error case in derpWriteChanOfAddrDenton Gentry2-1/+84
In derpWriteChanOfAddr when we call derphttp.NewRegionClient(), there is a check of whether the connection is already errored and if so it returns before grabbing the lock. The lock might already be held and would be a deadlock. This corner case is not being reliably exercised by other tests. This shows up in code coverage reports, the lines of code in derpWriteChanOfAddr are alternately added and subtracted from code coverage. Add a test to specifically exercise this code path, and verify that it doesn't deadlock. This is the best tradeoff I could come up with: + the moment code calls Err() to check if there is an error, we grab the lock to make sure it would deadlock if it tries to grab the lock itself. + if a new call to Err() is added in this code path, only the first one will be covered and the rest will not be tested. + this test doesn't verify whether code is checking for Err() in the right place, which ideally I guess it would. Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2021-01-11wgengine: on TCP connect fail/timeout, log some clues about why it failedBrad Fitzpatrick5-4/+206
So users can see why things aren't working. A start. More diagnostics coming. Updates #1094
2021-01-11net/packet: add TCPFlag type and some more constantsBrad Fitzpatrick2-8/+13
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-11net/flowtrack: add Tuple.String methodBrad Fitzpatrick1-0/+5
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-11all: adjust Unix permissions for those without umasksBrad Fitzpatrick5-6/+6
Fixes tailscale/corp#1165 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-11Dockerfile: add big warning bannerBrad Fitzpatrick1-0/+17
Updates #504
2021-01-11net/netcheck: improve the preferred DERP hysteresisBrad Fitzpatrick2-6/+42
Users in Amsterdam (as one example) were flipping back and forth between equidistant London & Frankfurt relays too much. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-11ipn: only send services in Hostinfo if Tailnet has opted-in to services ↵Sonia Appasamy4-25/+36
collection (#1107) Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2021-01-11wgengine/magicsock: drop netaddr.IPPort cacheBrad Fitzpatrick5-121/+11
netaddr.IP no longer allocates, so don't need a cache or all its associated code/complexity. This totally removes groupcache/lru from the deps. Also go mod tidy.
2021-01-11Update depaware (removes lru from wgengine/filter)Brad Fitzpatrick2-2/+4
2021-01-11net/flowtrack: add new package to specialize groupcache/lru key typeBrad Fitzpatrick3-15/+189
Reduces allocs. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-11wengine/netstack: bump gvisor to latest versionNaman Sood4-8/+121
* wengine/netstack: bump gvisor to latest version Signed-off-by: Naman Sood <naman@tailscale.com> * update dependencies Signed-off-by: Naman Sood <naman@tailscale.com> * Don't change hardcoded IP Signed-off-by: Naman Sood <naman@tailscale.com>
2021-01-11wgengine/netstack: don't build netstack on 32-bit platformsBrad Fitzpatrick2-0/+24
See google/gvisor#5241
2021-01-11cmd/tailscaled, wgengine/netstack: add start of gvisor userspace netstack workBrad Fitzpatrick11-15/+490
Not usefully functional yet (mostly a proof of concept), but getting it submitted for some work @namansood is going to do atop this. Updates #707 Updates #634 Updates #48 Updates #835
2021-01-10cmd/tailscale: change formatting of "tailscale status"Brad Fitzpatrick11-84/+167
* show DNS name over hostname, removing domain's common MagicDNS suffix. only show hostname if there's no DNS name. but still show shared devices' MagicDNS FQDN. * remove nerdy low-level details by default: endpoints, DERP relay, public key. They're available in JSON mode still for those who need them. * only show endpoint or DERP relay when it's active with the goal of making debugging easier. (so it's easier for users to understand what's happening) The asterisks are gone. * remove Tx/Rx numbers by default for idle peers; only show them when there's traffic. * include peers' owner login names * add CLI option to not show peers (matching --self=true, --peers= also defaults to true) * sort by DNS/host name, not public key * reorder columns
2021-01-08go.mod: bump wireguard-go to match our meta repoBrad Fitzpatrick1-1/+1
2021-01-08wgengine/magicsock: copy self DNS name to PeerStatus, re-fill OSBrad Fitzpatrick1-1/+2
The OS used to be sent back from the server but that has since been removed as being redundant.
2021-01-08go.sum: updateBrad Fitzpatrick1-0/+2
2021-01-08wgengine/tstun: initialize wireguard-go TUN parametersJosh Bleecher Snyder3-2/+26
This will enable us to remove the corresponding code from our fork of wireguard-go. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-08ipn: close logger at the end of TestLocalLogLinesJosh Bleecher Snyder2-2/+15
If any goroutine continues to use the logger in TestLocalLogLines after the test finishes, the test panics. The culprit for this was wireguard-go; the previous commit fixed that. This commit adds suspenders: When the test is done, make logging calls into no-ops. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-08wgengine: quiet some wireguard-go loggingJosh Bleecher Snyder2-1/+20
The log lines that wireguard-go prints as it starts and stops its worker routines are mostly noise. They also happen after other work is completed, which causes failures in some of the log testing packages. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-08go.mod: change wireguard-go version spellingJosh Bleecher Snyder1-1/+1
Our toolchains disagree about the spelling. Sigh. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-08go.mod: update wireguard-go to fix windows build failureJosh Bleecher Snyder1-1/+1
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-08go.mod: update to latest wireguard-goJosh Bleecher Snyder1-1/+1