summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-02-17net/tshttpproxy: support basic auth when availableXe/derphttp-panic-fixChristine Dodrill2-0/+61
This allows proxy URLs such as: http://azurediamond:hunter2@192.168.122.154:38274 to be used in order to dial out to control, logs or derp servers. Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-02-16ipn/ipnserver: on darwin, let users who are admins use CLI without sudoBrad Fitzpatrick1-4/+56
Tangentially related to #987, #177, #594, #925, #505 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-16safesocket, ipn/ipnserver: look up peer creds on DarwinBrad Fitzpatrick7-79/+24
And open up socket permissions like Linux, now that we know who connections are from. This uses the new inet.af/peercred that supports Linux and Darwin at the moment. Fixes #1347 Fixes #1348 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-16wgengine/tsdns: skip test that requires local IPv6 when IPv6 unavailableBrad Fitzpatrick2-7/+27
Fixes #1292 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-15control/controlclient: note package type in HostinfoBrad Fitzpatrick1-0/+16
Fixes tailscale/corp#440 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-15tailcfg: add Hostinfo.PackageBrad Fitzpatrick3-1/+3
Updates tailscale/corp#440
2021-02-15safesocket: make ConnectDefault use paths pkg, fixing tailscaled-on-macOSBrad Fitzpatrick2-2/+4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-15cmd/hello: make whois client work on macOS against GUI clientBrad Fitzpatrick1-1/+30
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-15ipn/ipnserver, ipn/ipnlocal: move whois handler to new localapi packageBrad Fitzpatrick3-46/+119
2021-02-15wgengine/monitor: prevent shutdown hang in darwin link monitorBrad Fitzpatrick1-3/+10
2021-02-15safesocket, wgengine: add some darwin failure diagnostic hintsBrad Fitzpatrick2-8/+33
2021-02-14net/{interfaces,netns}: add some new tests, missed from prior commitBrad Fitzpatrick2-0/+59
I meant for these to be part of 52e24aa966ffa.
2021-02-14net/interfaces: fix staticcheck error on darwinBrad Fitzpatrick1-2/+2
2021-02-14cmd/tailscaled: fix up install-system-daemon on darwin, add uninstall tooBrad Fitzpatrick3-16/+61
Tangentially related to #987, #177, #594, #925, #505
2021-02-14net/{interfaces,ns}: add tailscaled-mode darwin routing looping preventionBrad Fitzpatrick6-4/+137
Fixes #1331 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-13wgengine/monitor: add a darwin implementation for tailscaled modeBrad Fitzpatrick2-1/+66
Tangentially related to #987, #177, #594, #925, #505 Motivated by rebooting a launchd-controlled tailscaled and it going into SetNetworkUp(false) mode immediately because there really is no network up at system boot, but then it got stuck in that paused state forever, without a monitor implementation.
2021-02-13cmd/tailscaled: add subcommand on darwin to install+start tailscaled under ↵Brad Fitzpatrick2-4/+122
launchd Tangentially related to #987, #177, #594, #925.
2021-02-13paths: update some default paths for darwinBrad Fitzpatrick2-0/+5
2021-02-12net/interfaces: reconcile interface filtering with address printing in logsBrad Fitzpatrick1-10/+18
The interface.State logging tried to only log interfaces which had interesting IPs, but the what-is-interesting checks differed between the code that gathered the interface names to print and the printing of their addresses.
2021-02-12wgengine/magicsock: retry and re-send packets in TestTwoDevicePingJosh Bleecher Snyder1-28/+42
When a handshake race occurs, a queued data packet can get lost. TestTwoDevicePing expected that the very first data packet would arrive. This caused occasional flakes. Change TestTwoDevicePing to repeatedly re-send packets and succeed when one of them makes it through. This is acceptable (vs making WireGuard not drop the packets) because this only affects communication with extremely old clients. And those extremely old clients will eventually connect, because the kernel will retry sends on timeout. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-12derp/derphttp: return nicer errors from Recv on CloseBrad Fitzpatrick1-0/+9
2021-02-12derp/derphttp: add a context and infoLogger option to RunWatchConnectionLoopBrad Fitzpatrick2-9/+30
2021-02-12wgengine/magicsock: reduce log spam during testsJosh Bleecher Snyder1-4/+5
Only do the type assertion to *net.UDPAddr when addr is non-nil. This prevents a bunch of log spam during tests.
2021-02-12wgengine/magicsock: remove an alloc from ReceiveIPvNJosh Bleecher Snyder2-24/+132
We modified the standard net package to not allocate a *net.UDPAddr during a call to (*net.UDPConn).ReadFromUDP if the caller's use of the *net.UDPAddr does not cause it to escape. That is https://golang.org/cl/291390. This is the companion change to magicsock. There are two changes required. First, call ReadFromUDP instead of ReadFrom, if possible. ReadFrom returns a net.Addr, which is an interface, which always allocates. Second, reduce the lifetime of the returned *net.UDPAddr. We do this by immediately converting it into a netaddr.IPPort. We left the existing RebindingUDPConn.ReadFrom method in place, as it is required to satisfy the net.PacketConn interface. With the upstream change and both of these fixes in place, we have removed one large allocation per packet received. name old time/op new time/op delta ReceiveFrom-8 16.7µs ± 5% 16.4µs ± 8% ~ (p=0.310 n=5+5) name old alloc/op new alloc/op delta ReceiveFrom-8 112B ± 0% 64B ± 0% -42.86% (p=0.008 n=5+5) name old allocs/op new allocs/op delta ReceiveFrom-8 3.00 ± 0% 2.00 ± 0% -33.33% (p=0.008 n=5+5) Co-authored-by: Sonia Appasamy <sonia@tailscale.com> Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-12wgengine/magicsock: unify on netaddr types in addrSetJosh Bleecher Snyder3-129/+74
addrSet maintained duplicate lists of netaddr.IPPorts and net.UDPAddrs. Unify to use the netaddr type only. This makes (*Conn).ReceiveIPvN a bit uglier, but that'll be cleaned up in a subsequent commit. This is preparatory work to remove an allocation from ReceiveIPv4. Co-authored-by: Sonia Appasamy <sonia@tailscale.com> Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-12wgengine/magicsock: prevent logging while running benchmarksJosh Bleecher Snyder1-0/+1
Co-authored-by: Sonia Appasamy <sonia@tailscale.com> Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-11version: bump dateBrad Fitzpatrick1-1/+1
2021-02-11cmd/tailscaled: pick automatic tun device name on darwinBrad Fitzpatrick1-0/+4
2021-02-11wgengine/router: fix BSD router to support multiple local addrs, IPv6Brad Fitzpatrick1-43/+68
Fixes #1201
2021-02-11cmd/hello: truncate long strings (#1328)Ross Zurowski1-6/+21
Signed-off-by: Ross Zurowski <ross@rosszurowski.com>
2021-02-11cmd/hello: chop DNS name at first dotBrad Fitzpatrick1-1/+9
2021-02-11cmd/hello: style welcome message (#1325)Ross Zurowski2-28/+438
Signed-off-by: Ross Zurowski <ross@rosszurowski.com>
2021-02-11wgengine/tstun: reply to MagicDNS pingsBrad Fitzpatrick1-0/+10
Fixes #849 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-11cmd/hello: serve fake data in dev mode on whois failureBrad Fitzpatrick1-9/+21
2021-02-11cmd/hello: in dev mode, live reload templateBrad Fitzpatrick1-1/+20
2021-02-10go.mod: update to latest wireguard-goJosh Bleecher Snyder2-1/+3
All changes are trivial.
2021-02-10wgengine/magicsock: increase legacy ping timeout againJosh Bleecher Snyder2-4/+22
I based my estimation of the required timeout based on locally observed behavior. But CI machines are worse than my local machine. 16s was enough to reduce flakiness but not eliminate it. Bump it up again. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-10wgengine/router: add another Windows firewall rule to allow incoming UDPBrad Fitzpatrick1-5/+39
Based on @sailorfrag's research. Fixes #1312 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-10wgengine/magicsock: reconnect to DERP home after network comes back upBrad Fitzpatrick1-6/+14
Updates #1310
2021-02-10go.mod: pull in upstream wireguard-go bug fixesJosh Bleecher Snyder2-1/+3
2021-02-09portlist, version: update build tags for Go 1.16, Apple M1moncho6-6/+6
Build tags have been updated to build native Apple M1 binaries, existing build tags for ios have been changed from darwin,arm64 to ios,arm64. With this change, running go build cmd/tailscale{,d}/tailscale{,d}.go on an Apple machine with the new processor works and resulting binaries show the expected architecture, e.g. tailscale: Mach-O 64-bit executable arm64. Tested using go version go1.16beta1 darwin/arm64. Updates #943 Signed-off-by: moncho <50428+moncho@users.noreply.github.com>
2021-02-09wgengine/winnet: don't build on non-windowsBrad Fitzpatrick1-1/+4
It only affects 'go install ./...', etc, and only on darwin/arm64 (M1 Macs) where the go-ole package doesn't compile. No need to build it. Updates #943
2021-02-09go.mod: bump to latest wireguard-goJosh Bleecher Snyder2-1/+3
Stabilization and performance improvements.
2021-02-09wgengine/magicsock: fix typo in commentBrad Fitzpatrick1-1/+1
2021-02-09wgengine/tstun: inform userspaceEngine about injected outbound packets in tundevNaman Sood1-3/+9
Signed-off-by: Naman Sood <mail@nsood.in>
2021-02-08wgengine: remove IpcGetOperation filterJosh 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: fix DERP reader hang regression during concurrent readsBrad Fitzpatrick2-37/+92
Fixes #1282 Signed-off-by: Brad Fitzpatrick <bradfitz@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>