summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-06-09tstest/integration: fix TestAddPingRequest flakingsimenghe/flakeresolveSimeng He1-1/+12
Added a ticker to readd PingRequests if the previous one was stuck Signed-off-by: Simeng He <simeng@tailscale.com>
2021-06-08net/dns/resolver: permit larger max responses, signal truncationAdrian Dewhurst7-9/+199
This raises the maximum DNS response message size from 512 to 4095. This should be large enough for almost all situations that do not need TCP. We still do not recognize EDNS, so we will still forward requests that claim support for a larger response size than 4095 (that will be solved later). For now, when a response comes back that is too large to fit in our receive buffer, we now set the truncation flag in the DNS header, which is an improvement from before but will prompt attempts to use TCP which isn't supported yet. On Windows, WSARecvFrom into a buffer that's too small returns an error in addition to the data. On other OSes, the extra data is silently discarded. In this case, we prefer the latter so need to catch the error on Windows. Partially addresses #1123 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2021-06-08client/tailscale: document SetDNS moreBrad Fitzpatrick1-1/+14
Updates #1235 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-08client/tailscale: add SetDNS funcBrad Fitzpatrick1-0/+9
Updates #1235 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-08control/controlclient: add Pinger interface, Options.PingerSimeng He1-0/+15
Plumbs down a pinger to the direct to enable client to client Ping functionality from control. Signed-off-by: Simeng He <simeng@tailscale.com>
2021-06-08go.mod: bump github.com/mdlayher/netlink to v1.4.1Matt Layher3-38/+21
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-06-08.github/workflows: add integration test with a custom runner (#2044)Christine Dodrill2-0/+113
This runner is in my homelab while we muse about a better, more permanent home for these tests. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-08tstest/integration/vms: download images from s3 (#2035)Christine Dodrill4-29/+197
This makes integration tests pull pristine VM images from Amazon S3 if they don't exist on disk. If the S3 fetch fails, it will fall back to grabbing the image from the public internet. The VM images on the public internet are known to be updated without warning and thusly change their SHA256 checksum. This is not ideal for a test that we want to be able to fire and forget, then run reliably for a very long time. This requires an AWS profile to be configured at the default path. The S3 bucket is rigged so that the requester pays. The VM images are currently about 6.9 gigabytes. Please keep this in mind when running these tests on your machine. Documentation was added to the integration test folder to aid others in running these tests on their machine. Some wording in the logs of the tests was altered. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-08tstest/integration/vms: bump images, fix caching bug (#2052)Christine Dodrill1-15/+14
Before this redownloaded the image every time. Now it only redownloads it when it needs to. Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-07ipn/{ipnlocal,localapi}, control/controlclient: add SetDNS localapiBrad Fitzpatrick6-0/+117
Updates #1235 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-07packages/deb: add package to extract metadata from .deb files.David Anderson2-0/+386
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-06-07cmd/mkpkg: allow zero files in a package.David Anderson1-0/+3
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-06-07net/dns/resolver: don't spam logs on EHOSTUNREACH.David Anderson1-0/+7
Fixes #1719. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-06-07tstest/integration/testcontrol: add Server.AddPingRequestSimeng He2-0/+76
Signed-off-by: Simeng He <simeng@tailscale.com>
2021-06-05build_dist.sh: add a command to output the shell vars.David Anderson1-1/+9
Some downstream distros eval'd version/version.sh to get at the shell variables within their own build process. They can now `./build_dist.sh shellvars` to get those. Fixes #2058. Signed-off-by: David Anderson <dave@natulte.net>
2021-06-04wgengine/wglog: match upstream wireguard-go's code for wireguardGoStringJosh Bleecher Snyder1-14/+16
It is a bit faster. But more importantly, it matches upstream byte-for-byte, which ensures there'll be no corner cases in which we disagree. name old time/op new time/op delta SetPeers-8 3.58µs ± 0% 3.16µs ± 2% -11.74% (p=0.016 n=4+5) name old alloc/op new alloc/op delta SetPeers-8 2.53kB ± 0% 2.53kB ± 0% ~ (all equal) name old allocs/op new allocs/op delta SetPeers-8 99.0 ± 0% 99.0 ± 0% ~ (all equal) Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-06-04tstest/integration/vms: add DownloadImages test to download images (#2039)Christine Dodrill1-37/+56
The image downloads can take a significant amount of time for the tests. This creates a new test that will download every distro image into the local cache in parallel, optionally matching the distribution regex. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-04tstest/integration/vms: aggressively re-verify shasums (#2050)Christine Dodrill1-14/+34
I've run into a couple issues where the tests time out while a VM image is being downloaded, making the cache poisoned for the next run. This moves the hash checking into its own function and calls it much sooner in the testing chain. If the hash check fails, the OS is redownloaded. Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-04net/tstun: add a debug envvar to override tun MTU.David Anderson1-6/+13
Signed-off-by: David Anderson <dave@natulte.net>
2021-06-04tstest/integration/vms: log qemu output (#2047)Christine Dodrill1-0/+3
Most of the time qemu will output nothing when it is running. This is expected behavior. However when qemu is unable to start due to some problem, it prints that to either stdout or stderr. Previously this output wasn't being captured. This patch captures that output to aid in debugging qemu issues. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-04tstest/integration/testcontrol: add Server.nodeLockedBrad Fitzpatrick1-0/+7
2021-06-03build_dist.sh: fix after the change to version stamping.David Anderson1-2/+24
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-06-03version: bump dateBrad Fitzpatrick1-1/+1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-03version: fix Short when link-stampedBrad Fitzpatrick1-6/+7
And remove old SHORT, LONG deprecated variables. Fixes tailscale/corp#1905 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-03ipn/ipnlocal: avoid initPeerAPIListener crash on certain concurrent actionsBrad Fitzpatrick1-0/+9
We were crashing on in initPeerAPIListener when called from authReconfig when b.netMap is nil. But authReconfig already returns before the call to initPeerAPIListener when b.netMap is nil, but it releases the b.mu mutex before calling initPeerAPIListener which reacquires it and assumes it's still nil. The only thing that can be setting it to nil is setNetMapLocked, which is called by ResetForClientDisconnect, Logout/logout, or Start, all of which can happen during an authReconfig. So be more defensive. Fixes #1996 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-03net/{interfaces,netns}: change which build tag means mac/ios Network/System ↵Brad Fitzpatrick5-70/+72
Extension We used to use "redo" for that, but it was pretty vague. Also, fix the build tags broken in interfaces_default_route_test.go from a9745a0b684bb92ccb1965709adea6e9a98c0cd6, moving those Linux-specific tests to interfaces_linux_test.go. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-03tstest/integration/vms: only build binaries once (#2042)Christine Dodrill1-6/+7
Previously this built the binaries for every distro. This is a bit overkill given we are using static binaries. This patch makes us only build once. There was also a weird issue with how processes were being managed. Previously we just killed qemu with Process.Kill(), however that was leaving behind zombies. This has been mended to not only kill qemu but also waitpid() the process so it doesn't become a zombie. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-03tstest/integration/vms: fix OpenSUSE Leap 15.1 (#2038)Christine Dodrill3-6/+95
The OpenSUSE 15.1 image we are using (and conseqentially the only one that is really available easily given it is EOL) has cloud-init hardcoded to use the OpenStack metadata thingy. Other OpenSUSE Leap images function fine with the NoCloud backend, but this one seems to just not work with it. No bother, we can just pretend to be OpenStack. Thanks to Okami for giving me an example OpenStack configuration seed image. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-03tstest/integration/vms: test on Arch Linux (#2040)Christine Dodrill1-0/+1
Arch is a bit of a weirder distro, however as a side effect it is much more of a systemd purist experience. Adding it to our test suite will make sure that we are working in the systemd happy path. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-06-03cmd/tailscale/web: restrict web access to synology admins.Maisem Ali3-14/+74
Signed-off-by: Maisem Ali <maisem@tailscale.com>
2021-06-02version: remove all the redo stuff, only support embedding via go ldflags.David Anderson12-318/+6
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-06-02go.mod: update netaddrBrad Fitzpatrick6-9/+17
Involves minor IPSetBuilder.Set API change. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-01tailcfg: add SetDNSRequest typeBrad Fitzpatrick1-0/+28
Updates #1235 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-06-01tstest/integration/vms: add OpenSUSE Leap 15.3 (#2026)Christine Dodrill1-0/+1
This distro is about to be released. OpenSUSE has historically had the least coverage for functional testing, so this may prove useful in the future. Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-05-31go.mod: update for corp resync.David Anderson1-2/+2
2021-05-31util/dnsname: make ToFQDN take exactly 0 or 1 allocs for everything.David Anderson1-64/+29
name old time/op new time/op delta ToFQDN/www.tailscale.com.-32 9.55ns ± 2% 12.13ns ± 3% +27.03% (p=0.000 n=10+10) ToFQDN/www.tailscale.com-32 86.3ns ± 1% 40.7ns ± 1% -52.86% (p=0.000 n=10+9) ToFQDN/.www.tailscale.com-32 86.5ns ± 1% 40.4ns ± 1% -53.29% (p=0.000 n=10+9) ToFQDN/_ssh._tcp.www.tailscale.com.-32 12.8ns ± 2% 14.7ns ± 2% +14.24% (p=0.000 n=9+10) ToFQDN/_ssh._tcp.www.tailscale.com-32 104ns ± 1% 45ns ± 0% -57.16% (p=0.000 n=10+9) name old alloc/op new alloc/op delta ToFQDN/www.tailscale.com.-32 0.00B 0.00B ~ (all equal) ToFQDN/www.tailscale.com-32 72.0B ± 0% 24.0B ± 0% -66.67% (p=0.000 n=10+10) ToFQDN/.www.tailscale.com-32 72.0B ± 0% 24.0B ± 0% -66.67% (p=0.000 n=10+10) ToFQDN/_ssh._tcp.www.tailscale.com.-32 0.00B 0.00B ~ (all equal) ToFQDN/_ssh._tcp.www.tailscale.com-32 112B ± 0% 32B ± 0% -71.43% (p=0.000 n=10+10) name old allocs/op new allocs/op delta ToFQDN/www.tailscale.com.-32 0.00 0.00 ~ (all equal) ToFQDN/www.tailscale.com-32 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) ToFQDN/.www.tailscale.com-32 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) ToFQDN/_ssh._tcp.www.tailscale.com.-32 0.00 0.00 ~ (all equal) ToFQDN/_ssh._tcp.www.tailscale.com-32 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=10+10) Signed-off-by: David Anderson <danderson@tailscale.com>
2021-05-31util/dnsname: add a benchmark for ToFQDN.David Anderson1-0/+21
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-05-31util/dnsname: don't validate the contents of DNS labels.David Anderson2-24/+17
DNS names consist of labels, but outside of length limits, DNS itself permits any content within the labels. Some records require labels to conform to hostname limitations (which is what we implemented before), but not all. Fixes #2024. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-05-31tstest/integration/vms: test vms as they are ready (#2022)Christine Dodrill1-111/+104
Instead of testing all the VMs at once when they are all ready, this patch changes the testing logic so that the vms are tested as soon as they register with testcontrol. Also limit the amount of VM ram used at once with the `-ram-limit` flag. That uses a semaphore to guard resource use. Also document CentOS' sins. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-05-31ipnlocal: in Start() fast path, don't forget to send Prefs.Avery Pennarun2-4/+2
The resulting empty Prefs had AllowSingleHosts=false and Routeall=false, so that on iOS if you did these steps: - Login and leave running - Terminate the frontend - Restart the frontend (fast path restart, missing prefs) - Set WantRunning=false - Set WantRunning=true ...then you would have Tailscale running, but with no routes. You would also accidentally disable the ExitNodeID/IP prefs (symptom: the current exit node setting didn't appear in the UI), but since nothing else worked either, you probably didn't notice. The fix was easy enough. It turns out we already knew about the problem, so this also fixes one of the BUG entries in state_test. Fixes: #1918 (BUG-1) and some as-yet-unreported bugs with exit nodes. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2021-05-31ipnlocal: don't assume NeedsLogin immediately after StartLogout().Avery Pennarun5-26/+43
Previously, there was no server round trip required to log out, so when you asked ipnlocal to Logout(), it could clear the netmap immediately and switch to NeedsLogin state. In v1.8, we added a true Logout operation. ipn.Logout() would trigger an async cc.StartLogout() and *also* immediately switch to NeedsLogin. Unfortunately, some frontends would see NeedsLogin and immediately trigger a new StartInteractiveLogin() operation, before the controlclient auth state machine actually acted on the Logout command, thus accidentally invalidating the entire logout operation, retaining the netmap, and violating the user's expectations. Instead, add a new LogoutFinished signal from controlclient (paralleling LoginFinished) and, upon starting a logout, don't update the ipn state machine until it's received. Updates: #1918 (BUG-2) Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2021-05-31tstest/integration/vms: regex-match distros using a flag (#2021)Christine Dodrill3-2/+70
If you set `-distro-regex` to match a subset of distros, only those distros will be tested. Ex: $ go test -run-vm-tests -distro-regex='opensuse' Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-05-31tstest/integration/vms: maintain distro info (#2020)Christine Dodrill1-24/+31
This lets us see the names of distros in our tests. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-05-31tstest/integration/vms: fix bindhost lookup (#2012)Brad Fitzpatrick1-21/+14
Don't try to do heuristics on the name. Use the net/interfaces package which we already have to do this sort of stuff. Fixes #2011 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-05-31tstest/integration/vms: copy locally built binaries (#2006)Christine Dodrill5-117/+291
Instead of pulling packages from pkgs.tailscale.com, we should use the tailscale binaries that are local to this git commit. This exposes a bit of the integration testing stack in order to copy the binaries correctly. This commit also bumps our version of github.com/pkg/sftp to the latest commit. If you run into trouble with yaml, be sure to check out the commented-out alpine linux image complete with instructions on how to use it. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-05-28net/tsaddr: simplify TailscaleServiceIPBrad Fitzpatrick2-17/+9
netaddr allocated at the time this was written. No longer. name old time/op new time/op delta TailscaleServiceAddr-4 5.46ns ± 4% 1.83ns ± 3% -66.52% (p=0.008 n=5+5) A bunch of the others can probably be simplified too, but this was the only one with just an IP and not an IPPrefix. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-05-28tstest/integration/vms: skip a test for nowBrad Fitzpatrick1-0/+1
Updates #2011 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-05-28wgengine/magicsock: delete dead codeJosh Bleecher Snyder1-20/+0
Co-authored-by: Adrian Dewhurst <adrian@tailscale.com> Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-05-28tstest/integration/vms: t.Log for VM output (#2007)Christine Dodrill1-3/+7
Previously we spewed a lot of output to stdout and stderr, even when `-v` wasn't set. This is sub-optimal for various reasons. This patch shunts that output to test logs so it only shows up when `-v` is set. Updates #1988 Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-05-28control/controlclient: use our fork of certstoreAdrian Dewhurst4-8/+6
The cyolosecurity fork of certstore did not update its module name and thus can only be used with a replace directive. This interferes with installing using `go install` so I created a tailscale fork with an updated module name. Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>