Brad Fitzpatrick
6757c990a8
Fix staticcheck warning, add Makefile with staticcheck targets, lock in staticcheck version in go.mod
6 years ago
Brad Fitzpatrick
08a6eeb55a
Fix staticcheck warning, add Makefile with staticcheck targets, lock in staticcheck version in go.mod
6 years ago
Brad Fitzpatrick
abd79ea368
derp: reduce DERP memory use; don't require callers to pass in memory to use
...
The magicsock derpReader was holding onto 65KB for each DERP
connection forever, just in case.
Make the derp{,http}.Client be in charge of memory instead. It can
reuse its bufio.Reader buffer space.
6 years ago
Brad Fitzpatrick
1cb7dab881
cmd/derper: support forwarding packets amongst set of peer DERP servers
...
Updates #388
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
5e0ff494a5
derp: change NewClient constructor to an option pattern
...
(The NewMeshClient constructor I added recently was gross in
retrospect at call sites, especially when it wasn't obvious that a
meshKey empty string meant a regular client)
6 years ago
Brad Fitzpatrick
484b7fc9a3
derp, cmd/derper: add frameWatchConns, framePeerPresent for inter-DERP routing
...
This lets a trusted DERP client that knows a pre-shared key subscribe
to the connection list. Upon subscribing, they get the current set
of connected public keys, and then all changes over time.
This lets a set of DERP server peers within a region all stay connected to
each other and know which clients are connected to which nodes.
Updates #388
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
1ab5b31c4b
derp, magicsock: send new "peer gone" frames when previous sender disconnects
...
Updates #150 (not yet enabled by default in magicsock)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
David Crawshaw
43aa8595dd
derp: introduce Conn interface
...
This lets us test with something other than a net.Conn.
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
6 years ago
Brad Fitzpatrick
6978b93bdd
derp, magicsock: track home (preferred) vs visiting connections for stats
6 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>
6 years ago
Brad Fitzpatrick
379a3125fd
derp, wgengine/magicsock: support more than just packets from Client.Recv
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
88f1cc0c98
derp, cmd/derper: add rate limiting support, add default 5Mbps limit
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
f029c4c82d
derp: change the protocol framing to always include a length
...
Addresses one of crawshaw's TODOs.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
1155716318
derp: rename some things in the client, add some docs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
259406e797
derp: move away from [32]byte key types
...
And some minor cleanup in the process.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
769e25e37b
derp: use new types/key package
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
2896be60db
Move "logger" package to under types, now that we have it.
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Brad Fitzpatrick
a59dc5f155
Use logger.Logf consistently. It was used in most places.
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
6 years ago
Earl Lee
a8d8b8719a
Move Linux client & common packages into a public repo.
6 years ago