Commit Graph

7497 Commits (d02f1be46ac384aa1937971092394562533e9456)
 

Author SHA1 Message Date
Brad Fitzpatrick eac62ec5ff ipn, wgengine/magicsock: add ipn.Prefs.DisableDERP bool
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
Brad Fitzpatrick bf704a5218 derp: protocol negotiation, add v2: send src pub keys to clients in packets
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
David Crawshaw a65b2a0efd magicsock: add some DERP tests
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw a33419167b magicsock: plumb through derpTLSConfig variable (for testing)
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw 9be9738f62 derphttp: add TLSConfig field
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw caec2c7e8b magicsock: test sequence of pings
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw 9f584414d9 magicsock: simple ping test via magicsock
Passes `go test -count=20 -race ./wgengine/magicsock`

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw 34859f8e7d wgengine, magicsock: add a CreateBind method
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw 75e62d318f magicsock: use local STUN server in tests
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
Brad Fitzpatrick 596fd449b9 netcheck: add TODO about alternate timing strategies 5 years ago
Brad Fitzpatrick b27d4c017a magicsock, wgengine, ipn, controlclient: plumb regular netchecks to map poll
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
Brad Fitzpatrick 4cf5ac3060 ipn/ipnserver: remove unnecessary closure parameter 5 years ago
Brad Fitzpatrick 724c37fb41 wgengine/magicsock: start tracking nearest DERP node 5 years ago
David Anderson dbc99dc0d2 paths: use /var/db for state on BSDs, and /var/run for sockets.
On BSD, /var/db is what linux calls /var/lib.

On modern linux, /run and /var/run are the same directory, but
on BSD the correct path is /var/run, so use that.

Fixes #79

Signed-off-by: David Anderson <dave@natulte.net>
5 years ago
David Anderson 20da44eae3 cmd/mkpkg: support scripts for rpm as well. 5 years ago
Brad Fitzpatrick e371520cc5 tsweb, derp: add expvar http.Handler for Prometheus's format
And add some opinions.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
Brad Fitzpatrick 89a2c3eb04 wgengine: don't create duplicate iptables rules on Linux, clean up
Fixes #131

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
David Anderson 21fc5ec371 cmd/mkpkg: support specifying that a package replaces another.
Both RPM and Deb require us to specify both Replaces and Conflicts:
Conflicts tells them that the packages cannot coexist on the system,
Replaces tells them which one to keep.
5 years ago
Brad Fitzpatrick dd68debd64 cmd/derper: set autocert Email
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
Brad Fitzpatrick 68ff31a0ba ipn: have NewFileStore try to create directories as needed 5 years ago
Brad Fitzpatrick b3d9eab1fe safesocket: make some effort to create parent directory of sock 5 years ago
Brad Fitzpatrick 383d86df5f paths: remove some debug logging I left in 5 years ago
Brad Fitzpatrick 65e7c58aa4 cmd/tailscale, cmd/tailscaled, paths: add paths package for default paths
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago
Brad Fitzpatrick 06092a3af3 ipn/ipnserver: document potential race, start on test for it 5 years ago
Brad Fitzpatrick ef1f967ec0 ipn: remove an unnecessary named parameter in doc 5 years ago
Brad Fitzpatrick 844d991baf netcheck: add Report.Clone, return cloned report to avoid races on late replies 5 years ago
Brad Fitzpatrick 657f9593ae Reduce some logspam. 5 years ago
David Crawshaw 61529ac459 controlclient, tailcfg: deliver DERP addresses in a separate field
We still include them directly in the controlclient network map
just where we have been. Client plumbing we can do later.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Anderson ca11e3804b Add a using section that points to pkgs.tailscale.com. 5 years ago
Brad Fitzpatrick 4675c70464 wgengine/magicsock: check STUN regularly 5 years ago
Brad Fitzpatrick 7172f3dbf4 version: add IsMobile func
And use it control/controlclient.
5 years ago
Brad Fitzpatrick 11489a6e67 go.sum: add lines 5 years ago
Brad Fitzpatrick bc7bc43fb8 magicsock, interfaces: move some code from magicsock to interfaces 5 years ago
Brad Fitzpatrick af7a01d6f0 wgengine/magicsock: drop donec channel, rename epUpdateCtx to serve its purpose 5 years ago
Brad Fitzpatrick a399ef3dc7 cmd/derper: appease staticcheck 5 years ago
Brad Fitzpatrick 051b6ef141 cmd/derper: accept more LetsEncrypt hostnames without explicit config 5 years ago
David Crawshaw cc4afa775f magicsock: rate limit send error log messages
The x/time/rate dependency adds 24kb to tailscaled binary size.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Anderson 9cdaeac00a go.mod: update wireguard-go version.
I accidentally crushed one of crawshaw's patches, fixing this now.
5 years ago
David Anderson 92bae83cc1 go.mod: update wireguard-go commit.
Signed-Off-By: David Anderson <dave@natulte.net>
5 years ago
David Crawshaw 719c974c38 go.mod: update wireguard-go version
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw 0752c77dc2 magicsock: keep DERP magic IPs out of the address map
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw c6550135d5 magicsock: remove the index from indexedAddrs
The value predates the introduction of AddrSet which replaces
the index by tracking curAddr directly.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Anderson 18fb98792b go.mod: update wireguard-go version.
Signed-off-by: David Anderson <dave@natulte.net>
5 years ago
David Anderson 061315acb4 go.mod: update version of wireguard-go.
Signed-Off-By: David Anderson <dave@natulte.net>
5 years ago
David Crawshaw 1dbd1babc9 go.mod: use latest wireguard-go version
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw d5050c37a5 go.mod: use latest wireguard-go version 5 years ago
David Crawshaw d417be6a4b controlclinet: clone filter.MatchAllowAll
This avoids a non-obvious data race, where the JSON decoder ends
up creating do-nothing writes into global variables.

	==================
	WARNING: DATA RACE
	Write at 0x0000011e1860 by goroutine 201:
	  tailscale.com/wgengine/packet.(*IP).UnmarshalJSON()
	      /home/crawshaw/repo/corp/oss/wgengine/packet/packet.go:83 +0x2d9
	  encoding/json.(*decodeState).literalStore()
	      /home/crawshaw/go/go/src/encoding/json/decode.go:877 +0x445e
	...
	  encoding/json.Unmarshal()
	      /home/crawshaw/go/go/src/encoding/json/decode.go:107 +0x1de
	  tailscale.com/control/controlclient.(*Direct).decodeMsg()
	      /home/crawshaw/repo/corp/oss/control/controlclient/direct.go:615 +0x1ab
	  tailscale.com/control/controlclient.(*Direct).PollNetMap()
	      /home/crawshaw/repo/corp/oss/control/controlclient/direct.go:525 +0x1053
	  tailscale.com/control/controlclient.(*Client).mapRoutine()
	      /home/crawshaw/repo/corp/oss/control/controlclient/auto.go:428 +0x3a6
	Previous read at 0x0000011e1860 by goroutine 86:
	  tailscale.com/wgengine/filter.matchIPWithoutPorts()
	      /home/crawshaw/repo/corp/oss/wgengine/filter/match.go:108 +0x91
	  tailscale.com/wgengine/filter.(*Filter).runIn()
	      /home/crawshaw/repo/corp/oss/wgengine/filter/filter.go:147 +0x3c6
	  tailscale.com/wgengine/filter.(*Filter).RunIn()
	      /home/crawshaw/repo/corp/oss/wgengine/filter/filter.go:127 +0xb0
	  tailscale.com/wgengine.(*userspaceEngine).SetFilter.func1()
	      /home/crawshaw/repo/corp/oss/wgengine/userspace.go:390 +0xfc
	  github.com/tailscale/wireguard-go/device.(*Device).RoutineDecryption()
	      /home/crawshaw/repo/corp/wireguard-go/device/receive.go:295 +0xa1f

For #112

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw 8aa2090919 go.mod: roll forward wireguard-go
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
David Crawshaw d133339216 ipn: always guard LocalBackend.prefs with mu
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
5 years ago
Brad Fitzpatrick bcf3719b9e netcheck: add hairpinning detection
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
5 years ago