summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2021-03-29cmd/tailscale: add web subcommandcrawshaw/cgiDavid Crawshaw5-4/+275
Used as an app frontend UI on Synology. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2021-03-29ipn/ipnlocal: push down a user-specific root dir to peerapi handlerBrad Fitzpatrick2-12/+111
And add a put handler. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-29wgengine/netstack: Allow userspace networking mode to expose subnets (#1588)Naman Sood1-38/+114
wgengine/netstack: Allow userspace networking mode to expose subnets Updates #504 Updates #707 Signed-off-by: Naman Sood <mail@nsood.in>
2021-03-28wgengine/monitor: on wall time jump, synthesize network change eventBrad Fitzpatrick1-28/+107
... to force rebinds of TCP connections Fixes #1555 Updates tailscale/felicity#4 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-28wgengine: rename Fake to RespondToPing.David Anderson1-7/+9
"Fake" doesn't mean a lot any more, given that many components of the engine can be faked out, including in valid production configurations like userspace-networking. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-28wgengine: make Tun optional again, default to fake.David Anderson3-11/+17
This makes setup more explicit in prod codepaths, without requiring a bunch of arguments or helpers for tests and userspace mode. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-28wgengine: optimize isLocalAddr a bitBrad Fitzpatrick2-25/+86
On macOS/iOS, this removes a map lookup per outgoing packet. Noticed it while reading code, not from profiles, but can't hurt. BenchmarkGenLocalAddrFunc BenchmarkGenLocalAddrFunc/map1 BenchmarkGenLocalAddrFunc/map1-4 16184868 69.78 ns/op BenchmarkGenLocalAddrFunc/map2 BenchmarkGenLocalAddrFunc/map2-4 16878140 70.73 ns/op BenchmarkGenLocalAddrFunc/or1 BenchmarkGenLocalAddrFunc/or1-4 623055721 1.950 ns/op BenchmarkGenLocalAddrFunc/or2 BenchmarkGenLocalAddrFunc/or2-4 472493098 2.589 ns/op Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-28go.mod: update to new wireguard-go version.David Anderson2-1/+3
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-28wgengine: default Router to a no-op router.David Anderson3-12/+17
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-28wgengine: remove Config.TUN argument.David Anderson2-4/+0
2021-03-27syncs: disable TestWatchMultipleValues on Windows CI buildsJosh Bleecher Snyder1-0/+9
The Windows CI machine experiences significant random execution delays. For example, in this code from watchdog.go: done := make(chan bool) go func() { start := time.Now() mu.Lock() There was a 500ms delay from initializing done to locking mu. This test checks that we receive a sufficient number of events quickly enough. In the face of random 500ms delays, unsurprisingly, the test fails. There's not much principled we can do about it. We could build a system of retries or attempt to detect these random delays, but that game isn't worth the candle. Skip the test. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-03-27wgengine: extend TestWatchdog timeout on macOSJosh Bleecher Snyder1-2/+10
This works around the close syscall being slow. We can revert this if we find a fix or if Apple makes close fast again. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-03-27wgengine: make the tun.Device required at construction.David Anderson3-14/+10
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: rename wrap_windows.go to tun_windows.go.David Anderson1-0/+0
The code has nothing to do with wrapping, it's windows-specific driver initialization code. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: document exported function.David Anderson1-0/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: rename TUN to Wrapper.David Anderson7-61/+58
The tstun packagen contains both constructors for generic tun Devices, and a wrapper that provides additional functionality. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: rename NewFakeTUN to NewFake.David Anderson4-7/+5
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: merge in wgengine/tstun.David Anderson11-11/+9
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26net/tstun: rename from net/tun.David Anderson6-9/+9
We depend on wireguard-go/tun, identical leaf packages can be confusing in code. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26wgengine: pass in an explicit router.Router, rather than a generator.David Anderson3-26/+21
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26cmd/tailscaled: readd tun.Diagnose call, mistakenly lost during refactor.David Anderson1-0/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26ipn/ipnlocal: rename/document peerapi stuff a bit, pass self identityBrad Fitzpatrick2-12/+25
So handlers can vary based on whether owner of peer matches owner of local node. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-26wgengine: remove Config.TUNName, require caller to create device.David Anderson7-148/+167
Also factors out device creation and associated OS workarounds to net/tun. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26wgengine/router: remove unused wireguard *Device argument.David Anderson11-27/+16
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-26ipn/ipnlocal: get peerapi ~working in macOS/iOS NetworkExtension sandboxBrad Fitzpatrick3-9/+94
IPv4 and IPv6 both work remotely, but IPv6 doesn't yet work from the machine itself due to routing mysteries. Untested yet on iOS, but previous prototype worked on iOS, so should work the same. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-26wgengine/monitor: fix OpenBSD buildBrad Fitzpatrick1-1/+2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-26net/interfaces: remove mutating methods, add EqualFiltered insteadBrad Fitzpatrick3-48/+76
Now callers (wgengine/monitor) don't need to mutate the state to remove boring interfaces before calling State.Equal. Instead, the methods to remove boring interfaces from the State are removed, as is the reflect-using Equal method itself, and in their place is a new EqualFiltered method that takes a func predicate to match interfaces to compare. And then the FilterInteresting predicate is added for use with EqualFiltered to do the job that that wgengine/monitor previously wanted. Now wgengine/monitor can keep the full interface state around, including the "boring" interfaces, which we'll need for peerapi on macOS/iOS to bind to the interface index of the utunN device. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-26ipn/ipnlocal: pass down interface state to peerapi ListenConfig hookBrad Fitzpatrick2-4/+6
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-26net/interfaces: track more interface metadata in StateBrad Fitzpatrick1-10/+10
We have it already but threw it away. But macOS/iOS code will be needing the interface index, so hang on to it. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-26control/controlclient: sign RegisterRequest (#1549)Adrian Dewhurst8-1/+298
control/controlclient: sign RegisterRequest Some customers wish to verify eligibility for devices to join their tailnets using machine identity certificates. TLS client certs could potentially fulfill this role but the initial customer for this feature has technical requirements that prevent their use. Instead, the certificate is loaded from the Windows local machine certificate store and uses its RSA public key to sign the RegisterRequest message. There is room to improve the flexibility of this feature in future and it is currently only tested on Windows (although Darwin theoretically works too), but this offers a reasonable starting place for now. Updates tailscale/coral#6 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2021-03-25many: gofmt.David Anderson8-8/+8
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-25Move DNS flush logic to net/dns.David Anderson2-6/+22
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-25wgengine/router/dns: move to net/dns.David Anderson21-12/+10
Preparation for merging the APIs and whatnot. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-25Move wgengine/tsdns to net/dns.David Anderson15-32/+32
Straight move+fixup, no other changes. In prep for merging with wgengine/router/dns. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-25ipn/ipnlocal: start of peerapi between nodesBrad Fitzpatrick4-60/+229
Also some necessary refactoring of the ipn/ipnstate too. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-25Revert "cmd/tailscaled: split package main into main shim + package"Brad Fitzpatrick8-47/+30
This reverts commit b81bd8025b71f35295201d18011855c1cfae630e. Not needed. See: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
2021-03-24cmd/tailscaled: split package main into main shim + packageBrad Fitzpatrick8-30/+47
So we can empty import the guts of cmd/tailscaled from another module for go mod tidy reasons. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-24wgengine: pass logger as a separate arg to device.NewDeviceJosh Bleecher Snyder5-15/+13
Adapt to minor API changes in wireguard-go. And factor out device.DeviceOptions variables. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-03-24cmd/tailscale: add "tailscale ip [-4] [-6]" commandBrad Fitzpatrick2-0/+70
This adds an easy and portable way for us to document how to get your Tailscale IP address. $ tailscale ip 100.74.70.3 fd7a:115c:a1e0:ab12:4843:cd96:624a:4603 $ tailscale ip -4 100.74.70.3 $ tailscale ip -6 fd7a:115c:a1e0:ab12:4843:cd96:624a:4603 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-24net/packet, wgengine/{filter,tstun}: add TSMP pingBrad Fitzpatrick13-18/+247
Fixes #1467 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-24wgengine/magicsock: check returned error in addTestEndpointJosh Bleecher Snyder1-4/+7
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-03-24go.sum: add entries for upstream wireguard-goJosh Bleecher Snyder1-0/+5
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-03-24tstest/natlab: use net.ErrClosedJosh Bleecher Snyder1-3/+1
We are now on 1.16. And wgconn.NetErrClosed has been removed upstream. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-03-23wgengine/magicsock: prefer IPv6 transport if roughly equivalent latencyBrad Fitzpatrick2-0/+34
Fixes #1566 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-23all: s/Magic DNS/MagicDNS/ for consistencyBrad Fitzpatrick4-4/+4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-23syncs: add SemaphoreBrad Fitzpatrick2-2/+72
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-23wgengine/magicsock: add an addrLatency type to combine an IPPort+time.DurationBrad Fitzpatrick2-17/+64
Updates #1566 (but no behavior changes as of this change) Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-22wgengine: log tailscale pingsBrad Fitzpatrick1-0/+4
Fixes #1561 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-22health: track whether any network interface is upBrad Fitzpatrick2-0/+13
Fixes #1562 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-03-22wgengine{,/magicsock}: fix, improve "tailscale ping" to default routes and ↵Brad Fitzpatrick3-54/+97
subnets e.g. $ tailscale ping 1.1.1.1 exit node found but not enabled $ tailscale ping 10.2.200.2 node "tsbfvlan2" found, but not using its 10.2.200.0/24 route $ sudo tailscale up --accept-routes $ tailscale ping 10.2.200.2 pong from tsbfvlan2 (100.124.196.94) via 10.2.200.34:41641 in 1ms $ tailscale ping mon.ts.tailscale.com pong from monitoring (100.88.178.64) via DERP(sfo) in 83ms pong from monitoring (100.88.178.64) via DERP(sfo) in 21ms pong from monitoring (100.88.178.64) via [2604:a880:4:d1::37:d001]:41641 in 22ms This necessarily moves code up from magicsock to wgengine, so we can look at the actual wireguard config. Fixes #1564 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>