summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-02-08wgengine: remove IpcGetOperation filterjosh/remove-ipcgetfilterJosh Bleecher Snyder1-6/+1
This was in place because retrieved allowed_ips was very expensive. Upstream changed the data structure to make them cheaper to compute. This commit is an experiment to find out whether they're now cheap enough. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-08wgengine/magicsock: allow more time for pings to transitJosh Bleecher Snyder1-4/+11
We removed the "fast retry" code from our wireguard-go fork. As a result, pings can take longer to transit when retries are required. Allow that. Fixes #1277 Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-06wgengine/magicsock: add disabled failing (deadlocking) test for #1282Brad Fitzpatrick2-21/+114
The fix can make this test run unconditionally. This moves code from 5c619882bc4911a2c9e7d0bb491b9e50d27afcd7 for testability but doesn't fix it yet. The #1282 problem remains (when I wrote its wake-up mechanism, I forgot there were N DERP readers funneling into 1 UDP reader, and the code just isn't correct at all for that case). Also factor out some test helper code from BenchmarkReceiveFrom. The refactoring in magicsock.go for testability should have no behavior change.
2021-02-05ipn/ipnlocal: don't short-circuit default route filtering.David Anderson1-4/+0
If no exit node is specified, the filter must still run to remove offered default routes from all peers. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-05types/netmap: split controlclient.NetworkMap off into its own leaf packageBrad Fitzpatrick19-124/+127
Updates #1278 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-05types/persist: split controlclient.Persist into a small leaf packageBrad Fitzpatrick13-107/+149
This one alone doesn't modify the global dependency map much (depaware.txt if anything looks slightly worse), but it leave controlclient as only containing NetworkMap: bradfitz@tsdev:~/src/tailscale.com/ipn$ grep -F "controlclient." *.go backend.go: NetMap *controlclient.NetworkMap // new netmap received fake_test.go: b.notify(Notify{NetMap: &controlclient.NetworkMap{}}) fake_test.go: b.notify(Notify{NetMap: &controlclient.NetworkMap{}}) handle.go: netmapCache *controlclient.NetworkMap handle.go:func (h *Handle) NetMap() *controlclient.NetworkMap { Once that goes into a leaf package, then ipn doesn't depend on controlclient at all, and then the client gets smaller. Updates #1278
2021-02-05cmd/tailscale/cli: display currently active exit node in `tailscale status`.David Anderson3-1/+11
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-05wgengine/wgcfg/nmcfg: split control/controlclient/netmap.go into own packageBrad Fitzpatrick8-141/+144
It couldn't move to ipnlocal due to test dependency cycles. Updates #1278 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-05tstest/natlab: use net.ErrClosed instead of a new errorJosh Bleecher Snyder2-1/+4
Upstream wireguard-go decided to use errors.Is(err, net.ErrClosed) instead of checking the error string. It also provided an unsafe linknamed version of net.ErrClosed for clients running Go 1.15. Switch to that. This reduces the time required for the wgengine/magicsock tests on my machine from ~35s back to the ~13s it was before 456cf8a3765948d6f1992162993eaf3844371592. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-05wgengine/magicsock: set a dummy private key in benchmark.David Anderson1-0/+1
Magicsock started dropping all traffic internally when Tailscale is shut down, to avoid spurious wireguard logspam. This made the benchmark not receive anything. Setting a dummy private key is sufficient to get magicsock to pass traffic for benchmarking purposes. Fixes #1270. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-05ipn: program exit node into the data plane according to user pref.David Anderson7-18/+158
Part of #1153, #1154. Fixes #1224. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-05cmd/tailscaled: rename Windows service to just TailscaleBrad Fitzpatrick1-1/+1
Updates #1232
2021-02-05logpolicy: on Windows, use tailscale-ipn log name if it already existedBrad Fitzpatrick1-0/+12
For the migration to tailscaled.exe on Windows, don't create a new logid if one existed under the old filename. Updates #1232
2021-02-05control/controlclient: don't call lite endpoint update path when logged outBrad Fitzpatrick1-1/+1
This was the other half of the #1271 problem. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-05cmd/tailscaled: move more of the Windows server setup code into tailscaledBrad Fitzpatrick5-9/+127
Updates #1232
2021-02-05cmd/tailscaled: add missing depaware.txt updateBrad Fitzpatrick1-0/+1
2021-02-05cmd/tailscaled: run as a service on WindowsBrad Fitzpatrick3-0/+87
Updates #1232
2021-02-04control/controlclient: avoid crash sending map request with zero node keyBrad Fitzpatrick1-0/+3
Fixes #1271 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-04wgengine: adapt to wireguard-go changesJosh Bleecher Snyder7-20/+27
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-04ipn: split LocalBackend off into new ipn/ipnlocal packageBrad Fitzpatrick19-240/+229
And move a couple other types down into leafier packages. Now cmd/tailscale doesn't bring in netlink, magicsock, wgengine, etc. Fixes #1181 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-04cmd/tailscale{,d}: move debug subcommand to tailscaledBrad Fitzpatrick5-36/+25
Work on reducing the size of the tailscale binary, which is currently pulling in most of the same code as tailscaled. Updates #1181
2021-02-04wgengine: access flow pending problem with lock heldBrad Fitzpatrick1-2/+3
Missed review feedback from just-submitted d37058af728c.
2021-02-04net/packet: add some more TSMP packet reject reasons and MaybeBroken bitBrad Fitzpatrick3-14/+106
Unused for now, but I want to backport this commit to 1.4 so 1.6 can start sending these and then at least 1.4 logs will stringify nicely. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-04logpolicy: rename target env var to TS_LOG_TARGET (#1267)Christine Dodrill1-1/+1
Signed-Off-By: Christine Dodrill <xe@tailscale.com>
2021-02-04wgengine/magicsock: filter disco packets and packets when stopped from wireguardBrad Fitzpatrick1-18/+37
Fixes #1167 Fixes tailscale/corp#219 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-04Add an environment variable to enable customizing the log target (#1243)Christine Dodrill1-0/+8
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-02-03Revert "tailcfg: remove v6-overlay debug option."David Anderson1-0/+2
This reverts commit da4ec54756d1f8970679872d093fe9fc0c2df417. Since v6 got disabled for Windows nodes, I need the debug flag back to figure out why it was broken. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-03tstest: simplify goroutine leak testsJosh Bleecher Snyder5-81/+33
Use tb.Cleanup to simplify both the API and the implementation. One behavior change: When the number of goroutines shrinks, don't log. I've never found these logs to be useful, and they frequently add noise. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-02cmd/tailscale: fix IPN message reading stall in tailscale status -webBrad Fitzpatrick1-1/+11
Fixes #1234 Updates #1254
2021-02-02wgengine/router: clarify disabled IPv6 message on LinuxBrad Fitzpatrick1-1/+1
2021-02-02net/interfaces: use a uint32_t for ipv4 addressDavid Crawshaw1-4/+4
The code was using a C "int", which is a signed 32-bit integer. That means some valid IP addresses were negative numbers. (In particular, the default router address handed out by AT&T fiber: 192.168.1.254. No I don't know why they do that.) A negative number is < 255, and so was treated by the Go code as an error. This fixes the unit test failure: $ go test -v -run=TestLikelyHomeRouterIPSyscallExec ./net/interfaces === RUN TestLikelyHomeRouterIPSyscallExec interfaces_darwin_cgo_test.go:15: syscall() = invalid IP, false, netstat = 192.168.1.254, true --- FAIL: TestLikelyHomeRouterIPSyscallExec (0.00s) Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2021-02-01wgengine/router: probe better for v6 policy routing support.David Anderson1-21/+28
Previously we disabled v6 support if the disable_policy knob was missing in /proc, but some kernels support policy routing without exposing the toggle. So instead, treat disable_policy absence as a "maybe", and make the direct `ip -6 rule` probing a bit more elaborate to compensate. Fixes #1241. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-01wgengine/wglog: don't log failure to send data packetsJosh Bleecher Snyder1-0/+4
Fixes #1239
2021-02-01tsweb: add num_goroutines expvarJosh Bleecher Snyder1-0/+1
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-01wgenginer/magicsock: remove Addrs methodsJosh Bleecher Snyder4-23/+14
They are now unused. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-01cmd/tailscale/cli: recommend sudo for 'tailscale up' on failureBrad Fitzpatrick2-2/+15
Fixes #1220
2021-02-01cmd/tailscaled/tailscaled.service: revert recent hardening for nowBrad Fitzpatrick1-19/+0
It broke Debian Stretch. We'll try again later. Updates #1245 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-30wgengine/wgcfg: fix validateEndpoints of empty stringBrad Fitzpatrick2-1/+23
Updates tailscale/corp#1238
2021-01-29safesocket: refactor macOS auth code, pull out separate LocalTCPPortAndTokenBrad Fitzpatrick5-31/+96
2021-01-29cmd/hello: use safesocket client to connectBrad Fitzpatrick2-6/+9
2021-01-29ipn/ipnserver, cmd/hello: do whois over unix socket, not debug httpBrad Fitzpatrick2-9/+36
Start of a local HTTP API. Not a stable interface yet.
2021-01-29all: move wgcfg from wireguard-goJosh Bleecher Snyder23-18/+1138
This is mostly code movement from the wireguard-go repo. Most of the new wgcfg package corresponds to the wireguard-go wgcfg package. wgengine/wgcfg/device{_test}.go was device/config{_test}.go. There were substantive but simple changes to device_test.go to remove internal package device references. The API of device.Config (now wgcfg.DeviceConfig) grew an error return; we previously logged the error and threw it away. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-29cmd/hello: new hello.ipn.dev serverBrad Fitzpatrick2-0/+133
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-28cmd/tailscaled: add whois/identd-ish debug handlerBrad Fitzpatrick3-0/+95
2021-01-28wgengine/router: don't configure IPv6 on Linux when IPv6 is unavailableBrad Fitzpatrick1-1/+12
Fixes #1214 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-28cmd/tailscaled: add /run to the allowed paths for iptables.David Anderson1-0/+2
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-01-28types/logger: fix rateFree interaction with verbosity prefixesJosh Bleecher Snyder1-4/+4
We log lines like this: c.logf("[v1] magicsock: disco: %v->%v (%v, %v) sent %v", c.discoShort, dstDisco.ShortString(), dstKey.ShortString(), derpStr(dst.String()), disco.MessageSummary(m)) The leading [v1] causes it to get unintentionally rate limited. Until we have a proper fix, work around it. Fixes #1216 Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-27VERSION.txt: this is 1.5.0.David Anderson1-1/+1
2021-01-27wgengine: don't leak TUN device in NewUserspaceEngine error pathBrad Fitzpatrick1-0/+1
Updates #1187 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-01-27wgengine: fix bugs from earlier fixBrad Fitzpatrick1-2/+5
Fixes a regression from e970ed09951a that wasn't covered by tests in this repo. (Our end-to-end tests in another repo caught this.) Updates #1204