Commit Graph

8143 Commits (fran/natc-consensus-prototype)
 

Author SHA1 Message Date
Brad Fitzpatrick c8cf3169ba cmd/derper, derp/derphttp: move bulk of derp mesh code into derphttp
To be reused in various other tools.
4 years ago
Brad Fitzpatrick 7cbf6ab771 cmd/derper: remove unused parameter in runMeshClient 4 years ago
Avery Pennarun 5d4415399b Merge remote-tracking branch 'origin/master' into main
* origin/master:
  Fix staticcheck warning, add Makefile with staticcheck targets, lock in staticcheck version in go.mod
4 years ago
Brad Fitzpatrick 6757c990a8 Fix staticcheck warning, add Makefile with staticcheck targets, lock in staticcheck version in go.mod 4 years ago
Brad Fitzpatrick 08a6eeb55a Fix staticcheck warning, add Makefile with staticcheck targets, lock in staticcheck version in go.mod 4 years ago
Avery Pennarun d9fd5db1e1 Rename master -> main.
Background:
https://www.zdnet.com/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/
4 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.
4 years ago
Quoc-Viet Nguyen 15a23ce65f net/stun: Remove unreachable code
- Reuse IP length constants from net package.
- Remove beu16 to make endianness functions consistent.

Signed-off-by: Quoc-Viet Nguyen <afelion@gmail.com>
4 years ago
Brad Fitzpatrick a036c8c718 version: add blank line to separate comment from package line
So it's not a package comment.
4 years ago
David Anderson 0371848097 Revert "version: delete GENERATE.go."
This reverts commit a447caebf8.
4 years ago
David Anderson 4c23b5e4ea version: remove leftover debug print.
Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson 03aa319762 version: add an AtLeast helper to compare versions.
Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson 9dd3544e84 version: bump oss datestamp.
Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson 1f4ccae591 version: remove comment about being unused.
version.SHORT is now being used in various places.

Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson a447caebf8 version: delete GENERATE.go.
It existed previously to persuade Go that redo-ful directory was
a Go package prior to the first build. But now we have other Go
files in the directory that will fulfil that function.

Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
Brad Fitzpatrick 50b2e5ffe6 log/logheap: appease staticcheck 4 years ago
Brad Fitzpatrick 8edcab04d5 log/logheap: change to POST to a URL instead of logging
It's too big to log.
4 years ago
Brad Fitzpatrick 51f421946f tailcfg: add some example strings in comments 4 years ago
Brad Fitzpatrick deb113838e net/netcheck: use logger.ArgWriter in logConciseReport, fix comma bug, add tests 4 years ago
Brad Fitzpatrick 280e8884dd wgengine/magicsock: limit redundant log spam on packets from low-pri addresses
Fixes #407

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
4 years ago
David Anderson d05b0500ac wgengine: loop back tuntap packets destined for local IPs.
macOS incorrectly sends packets for the local Tailscale IP
into our tunnel interface. We have to turn the packets around
and send them back to the kernel.

Fixes tailscale/corp#189.

Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
Zijie Lu d1a30be275 tsweb: JSONHandler: supports HTTPError
Signed-off-by: Zijie Lu <zijie@tailscale.com>
4 years ago
Avery Pennarun 51d176ecff wgengine: Remove leftover debug message.
Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
4 years ago
Dmytro Shynkevych 07e02ec9d3
wgengine/tsdns: add test and prevent useless updates (#449)
Signed-Off-By: Dmytro Shynkevych <dmytro@tailscale.com>
4 years ago
Dmytro Shynkevych 511840b1f6
tsdns: initial implementation of a Tailscale DNS resolver (#396)
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
4 years ago
Zijie Lu 5e1ee4be53 tsweb: fix JSONHandler nil response
Signed-off-by: Zijie Lu <zijie@tailscale.com>
4 years ago
Brad Fitzpatrick c3f7733f53 logpolicy: don't check version.CmdName on Windows unnecessarily
... it was crashing for some reason, running out of stack while
loading a DLL in goversion. I don't understand Windows (or the Go
runtime for Windows) enough to know why that'd be problematic in that
context.

In any case, don't call it, as tryFixLogStateLocation does nothing on
Windows anyway.

tryFixLogStateLocation should probably just call version.CmdName
itself if/when it needs to, after the GOOS check.
4 years ago
Brad Fitzpatrick 5c9ddf5e76 version: fix typo in comment 4 years ago
Brad Fitzpatrick 2ca2389c5f portlist: set SysProcAttr.HideWindow on Windows
Prevents annoying shell window flashes when running /server by hand.
4 years ago
Brad Fitzpatrick 07ca0c1c29 derp: fix tracking problem if conn starts local, then also joins mesh peer 4 years ago
Brad Fitzpatrick 39f2fe29f7 tempfork/registry: work around issue with Tailscale's redo build system
Updates tailscale/corp#293
4 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>
4 years ago
Brad Fitzpatrick e441d3218e tempfork/registry: add golang.org/x/sys/windows/registry + CL 236681
Temporary fork of golang.org/x/sys/windows/registry with:

   windows/registry: add Key.WaitChange wrapper around RegNotifyChangeKeyValue
   https://go-review.googlesource.com/c/sys/+/236681
4 years ago
Dmytro Shynkevych 02231e968e
wgengine/tstun: add tests and benchmarks (#436)
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
4 years ago
Avery Pennarun 6f590f5b52 logtail: we missed a case for the backoff timer.
We want to run bo.Backoff() after every upload, regardless. If
upload==true but err!=nil, we weren't backing off, which caused some
very-high-throughput log upload retries in bad network conditions.

Updates #282.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
4 years ago
halulu 1d2e497d47
tsweb: JSONHandler using reflect (#437)
Updates #395 #437

Signed-off-by: Zijie Lu <zijie@tailscale.com>
4 years ago
Dmytro Shynkevych 059b1d10bb
wgengine/packet: refactor and expose UDP header marshaling (#408)
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
4 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)
4 years ago
Brad Fitzpatrick 4d599d194f derp, derp/derphttp: add key accessors, add Client.RecvDetail
Client.RecvDetail returns a connection generation so interested clients
can detect when a reconnect happened. (Will be needed for #388)
4 years ago
Brad Fitzpatrick b33c86b542 derp: add an unexported key.Public zero value variable to be less verbose 4 years ago
Brad Fitzpatrick b663ab4685 cmd/derper: treat self-connection connection watch as no-op
Updates #388
4 years ago
Brad Fitzpatrick 5798826990 cmd/derper: add /home/bradfitz/keys to default mesh key search list 4 years ago
David Anderson e01a4c50ba go.mod: require Go 1.14, since we use some of its features.
Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson 5a32f8e181 wgengine/router: also accept exit code 254 from `ip rule del`.
iproute2 3.16.0-2 from Debian Jessie (oldoldstable) doesn't return
exit code 2 when deleting a non-existent IP rule.

Fixes #434

Signed-off-by: David Anderson <danderson@tailscale.com>
4 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>
4 years ago
David Anderson c62b80e00b cmd/tailscale: fix inverted flag meanings.
The flags were --no-blah for a brief time, then we switched them to
--blah=true/false with a default of true, but didn't fix the boolean
inversions in the code. So up was down, true was false, etc.

Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson cc687fc3e6 version: always include the long form version in describe.
Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson 08a38f21c9 wgengine/router: don't filter subnet routing in netfilter.
We have a filter in tailscaled itself now, which is more robust
against weird network topologies (such as the one Docker creates).

Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson c71754eba2 ipn/ipnserver: revert decoder memory limit.
The zstd library treats that limit as a hard cap on decompressed
size, in the mode we're using it, rather than a window size.

Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago
David Anderson d4127db0fe logpolicy: add a temporary fixup for #247.
Signed-off-by: David Anderson <danderson@tailscale.com>
4 years ago