summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-02-24Homebrew packaging of the non-IPNExtension, unsandboxed tailscale{d} ↵mkramlich/macos-brewMike Kramlich19-1/+905
releases for macOS/darwin. So the public can "brew install" tailscale and start it as a global boot daemon via brew services. supported: Homebrew 3.0, go1.15 darwin/amd64, macOS Catalina 10.15.3, Intel 64-bit probably also but unconfirmed: BigSur 11 and Apple M1 ARM64 NOTE: lots of upgrades and polish since 1st squashed WIP PR, and applies most prior feedback Part of #177. (WIP) Signed-off-by: Mike Kramlich <groglogic@gmail.com>
2021-02-23wgengine/magicsock: fix discoEndpoint caching bug when a node key changesBrad Fitzpatrick2-1/+73
Fixes #1391 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-23ipn/ipnserver: fix Windows connection auth regressionBrad Fitzpatrick1-0/+5
Regression from code movement in d3efe8caf636aaa9a8e02b65877878954ea980b7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-23net/portmapper: add NAT-PMP client, move port mapping service probingBrad Fitzpatrick9-104/+721
* move probing out of netcheck into new net/portmapper package * use PCP ANNOUNCE op codes for PCP discovery, rather than causing short-lived (sub-second) side effects with a 1-second-expiring map + delete. * track when we heard things from the router so we can be less wasteful in querying the router's port mapping services in the future * use portmapper from magicsock to map a public port Fixes #1298 Fixes #1080 Fixes #1001 Updates #864 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-23wgengine/wglog: drop 1/s "interface is up" messages.David Anderson1-0/+5
Fixes #1388. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-22wgengine: consistently close things when NewUserspaceEngineAdvanced errorsBrad Fitzpatrick1-19/+27
Fixes #1363 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-22wgengine/monitor: don't log any single-IP routes added to the tailscale table.David Anderson1-1/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-22wgengine/monitor: on linux, also monitor for IPv6 changes.David Anderson1-6/+5
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-22wgengine/filter: use IPSet for localNets instead of prefixes.David Anderson6-35/+39
Part of #1177, preparing for doing fancier set operations on the allowed local nets. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-02-22go.mod: bump github.com/mdlayher/netlink, github.com/jsimonetti/rtnetlinkMatt Layher3-8/+29
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-02-20tstest/staticcheck: import the main package to fix "go mod tidy"Filippo Valsorda2-1/+4
Importing the non-main package was missing some dependencies that "go mod tidy" would then cleanup. Also added a non-ignore build tag to avoid other tools getting upset about importing a main package. Signed-off-by: Filippo Valsorda <hi@filippo.io>
2021-02-20go.mod: bump github.com/kr/pty to build on openbsd/arm64Filippo Valsorda2-45/+5
$ GOOS=openbsd GOARCH=arm64 go install tailscale.com/cmd/...@latest pkg/mod/github.com/kr/pty@v1.1.4-0.20190131011033-7dc38fb350b1/pty_openbsd.go:24:10: undefined: ptmget pkg/mod/github.com/kr/pty@v1.1.4-0.20190131011033-7dc38fb350b1/pty_openbsd.go:25:34: undefined: ioctl_PTMGET "go mod tidy" did some unrelated work in go.sum, maybe because it was not run with Go 1.16 before. Signed-off-by: Filippo Valsorda <hi@filippo.io>
2021-02-19Switch to Go 1.16.Brad Fitzpatrick16-23/+23
Fixes #1370 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-19portlist: adjust build tags for iOS + Go 1.16Brad Fitzpatrick2-2/+4
Updates #943 Updates #1370 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-19cmd/tailscale/cli: add netcheck dev knob TS_DEBUG_NETCHECK_UDP_BINDBrad Fitzpatrick1-1/+3
2021-02-18cmd/tailscale/cli: remove outdated TODOBrad Fitzpatrick1-1/+0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-18dnsname,tailcfg: add hostname sanitation logic to node display names (#1304)Sonia Appasamy5-32/+194
Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2021-02-18version: bump dateBrad Fitzpatrick1-1/+1
2021-02-18health, control/controlclient, wgengine: report when router unhealthyBrad Fitzpatrick6-2/+98
Updates tailscale/corp#1338 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-18wgengine/router: make Linux delRoute idempotent, cidrDiff fail late as possibleBrad Fitzpatrick2-5/+128
This makes cidrDiff do as much as possible before failing, and makes a delete of an already-deleted rule be a no-op. We should never do this ourselves, but other things on the system can, and this should help us recover a bit. Also adds the start of root-requiring tests. TODO: hook into wgengine/monitor and notice when routes are changed behind our back, and invalidate our routes map and re-read from kernel (via the ip command) at least on the next reconfig call. Updates tailscale/corp#1338 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-18net/tshttpproxy: support HTTP proxy environment credentials on Windows tooBrad Fitzpatrick2-16/+18
and some minor style nits. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-17wgengine/router: simplify func normalizeCIDR using netaddr methodBrad Fitzpatrick1-3/+1
2021-02-17cmd/tailscaled: on darwin, fail early if not root with nicer messageBrad Fitzpatrick1-0/+6
Don't do it on all platforms, as Linux folk might be playing container + capability games.
2021-02-17net/tshttpproxy: support basic auth when available (#1354)Christine 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-17wgengine/filter: remove redundant codeBrad Fitzpatrick1-1/+1
no generated code change.
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>