Brad Fitzpatrick
0f64d7f9cc
wgengine: remove a tiny allocation
...
Drop in the bucket compared to the larger issues, but noticed it
when looking at pprof.
2020-04-07 22:23:40 -07:00
Brad Fitzpatrick
ec0cd60fc3
portlist: fail earlier, more nicely on iOS
2020-04-06 20:11:24 -07:00
Brad Fitzpatrick
71d6738333
tstime: change an Errorf+return to Fatalf in subtest
...
Forgot to git add this during review. Fail.
2020-04-06 08:20:15 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
febdac0499
tstime: write Parse3339 parse that doesn't use time.Parse
...
It doesn't allocate and it's half the time of time.Parse (which
allocates), and 2/3rds the time of time.ParseInLocation (which
doesn't).
Go with a UTC time:
BenchmarkGoParse3339/Z-8 2200995 534 ns/op 0 B/op 0 allocs/op
BenchmarkGoParse3339/Z-8 2254816 554 ns/op 0 B/op 0 allocs/op
BenchmarkGoParse3339/Z-8 2159504 522 ns/op 0 B/op 0 allocs/op
Go allocates with a "-08:00" suffix instead of ending in "Z":
BenchmarkGoParse3339/TZ-8 1276491 884 ns/op 144 B/op 3 allocs/op
BenchmarkGoParse3339/TZ-8 1355858 942 ns/op 144 B/op 3 allocs/op
BenchmarkGoParse3339/TZ-8 1385484 911 ns/op 144 B/op 3 allocs/op
Go doesn't allocate if you use time.ParseInLocation, but then you need
to parse the string to find the location anyway, so might as well go
all the way (below).
BenchmarkGoParse3339InLocation-8 1912254 597 ns/op 0 B/op 0 allocs/op
BenchmarkGoParse3339InLocation-8 1980043 612 ns/op 0 B/op 0 allocs/op
BenchmarkGoParse3339InLocation-8 1891366 612 ns/op 0 B/op 0 allocs/op
Parsing RFC3339 ourselves, UTC:
BenchmarkParse3339/Z-8 3889220 307 ns/op 0 B/op 0 allocs/op
BenchmarkParse3339/Z-8 3718500 309 ns/op 0 B/op 0 allocs/op
BenchmarkParse3339/Z-8 3621231 303 ns/op 0 B/op 0 allocs/op
Parsing RFC3339 ourselves, with timezone (w/ *time.Location fetched
from sync.Map)
BenchmarkParse3339/TZ-8 3019612 418 ns/op 0 B/op 0 allocs/op
BenchmarkParse3339/TZ-8 2921618 401 ns/op 0 B/op 0 allocs/op
BenchmarkParse3339/TZ-8 3031671 408 ns/op 0 B/op 0 allocs/op
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-06 08:19:17 -07:00
Brad Fitzpatrick
02948d2c86
Dockerfile: add some usage docs, bump to Go 1.14
2020-04-06 07:57:47 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
d503dee6f1
tstime: add new package for time utilities, starting with Parse3339
...
Go's time.Parse always allocates a FixedZone for time strings not in
UTC (ending in "Z"). This avoids that allocation, at the cost of
adding a cache.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-05 20:05:49 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
996bf9cae7
logtail: don't send a User-Agent
...
Just useless bytes on the wire. Especially with HTTP/1.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-05 13:16:56 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
7bf436ba30
tsweb: add some Benchmarks
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-05 13:16:36 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
64334143a1
tsweb: rename Handler to ReturnHandler
...
The name's been bugging me for a long time.
I liked neither the overlap between tsweb.Handler and http.Handler,
nor the name "ServeHTTPErr" which sounds like it's an error being
returned, like it's an error handler and not sometimes a happy path.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-05 13:16:36 -07:00
Brad Fitzpatrick
bdc55d7091
logtail: add ParsePrivateID
2020-04-05 09:15:15 -07:00
Brad Fitzpatrick
50aeb5b9ad
wgengine: unexport some windows funcs
2020-04-05 08:23:53 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
e71a7c7a2c
logtail: read to EOF on chunked response
...
We'll be fixing the server so this won't trigger in practice,
but it demos the connection reuse problem.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-04 16:12:15 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
fcb6a34f4b
logtail: reduce allocations encoding text
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-04 16:12:02 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
2863e49db9
tsweb: don't flush, treat no-op Handler as 200, like Go
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-04 16:11:53 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
3b4b17d239
logpolicy: log on dials, add knob to force HTTP/1 for log uploads
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-04 14:46:41 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
8ca796d144
ipn, ipn/policy: filter portlist to a short list of "interesting" ports
...
Adds new package ipn/policy to be shared between node client & control server.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-04-01 10:03:44 -07:00
Brad Fitzpatrick
c6aa5b639f
tailcfg: clarify Hostinfo.OS doc
2020-04-01 09:27:35 -07:00
Brad Fitzpatrick
4524dcf51e
version: move runtime.OS to tailscale OS mapping func to version
...
So other code can use this without duplicating the policy.
2020-04-01 08:50:56 -07:00
Brad Fitzpatrick
1df3c8d02a
derp, netcheck: make tests listen on localhost only
...
avoid macOS firewall pop-ups
2020-03-30 11:29:08 -07:00
Brad Fitzpatrick
5362e952e1
safesocket: gofmt
...
Was developed on a random machine without my normal environment.
2020-03-30 11:23:18 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
a4ef345737
cmd/tailscale: add status subcommand
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-27 20:34:36 -07:00
Brad Fitzpatrick
810c1e9704
types/key: make Public implement TextMarshaler, TextUnmarshaler
...
So it can be a map key with encoding/json
2020-03-27 13:03:35 -07:00
Brad Fitzpatrick
f51f18b42b
ipn: move FakeBackend to a test-only file
2020-03-27 13:02:33 -07:00
Brad Fitzpatrick
8ebee05fbd
cmd/tailscale: remove unnecessary logpolicy/logtail logging
2020-03-27 08:27:36 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
8b3f6be008
control/controlclient: flip IPv6 to be on by default
...
The DEBUG_INCLUDE_IPV6 environment variable is now an opt-out.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-26 22:02:56 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
322499473e
cmd/tailscaled, wgengine, ipn: add /debug/ipn handler with world state
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-26 14:26:24 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
7fb8d873ac
logpolicy: don't log timestamp when running under systemd
...
It'll do it anyway.
Makes journalctl -fu cleaner.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-25 21:03:06 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
2d48f92a82
wgengine/magicsock: re-stun every [20,27] sec, not 28
...
28 is cutting it close, and we think jitter will help some spikes
we're seeing.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-25 14:25:33 -07:00
Brad Fitzpatrick
2c7ddd0828
go.mod, go.sum: tidy
2020-03-25 14:05:33 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
577f321c38
wgengine/magicsock: revise derp fallback logic
...
Revision to earlier 6284454ae5
Don't be sticky if we have no peers.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-25 13:09:18 -07:00
Brad Fitzpatrick
2e420ad8b6
wgengine, wgengine/filter: minor doc, style, performance, locking changes
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-25 08:41:01 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
6284454ae5
wgengine/magicsock: if UDP blocked, pick DERP where most peers are
...
Updates #207
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-25 08:00:44 -07:00
Brad Fitzpatrick
d321190578
wgengine/magicsock: stringify [IPv6]:port normally in AddrSet.String
2020-03-24 13:40:43 -07:00
Brad Fitzpatrick
3c3ea8bc8a
wgengine/magicsock: finish IPv6 transport support
...
DEBUG_INCLUDE_IPV6=1 is still required, but works now.
Updates #18 (fixes it, once env var gate is removed)
2020-03-24 10:56:22 -07:00
Brad Fitzpatrick
82ed7e527e
wgengine/magicsock: remove log allocation
...
This was the whole point but I goofed at the last line.
2020-03-24 08:14:47 -07:00
Brad Fitzpatrick
8454bbbda5
wgengine/magicsock: more logging improvements
...
* remove endpoint discovery noise when results unchanged
* consistently spell derp nodes as "derp-N"
* replace "127.3.3.40:" with "derp-" in CreateEndpoint log output
* stop early DERP setup before SetPrivateKey is called;
it just generates log nosie
* fix stringification of peer ShortStrings (it had an old %x on it,
rendering it garbage)
* describe why derp routes are changing, with one of:
shared home, their home, our home, alt
2020-03-24 08:12:55 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
64aff0db7b
control/controlclient: add TODO to delete the UAPI method
2020-03-24 07:25:14 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
7740cbd8d9
ipn: call SetNetInfoCallback later, in Start
...
It was being called back into ultimately from magicsock before there
was a control client.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-23 22:19:40 -07:00
Brad Fitzpatrick
680311b3df
wgengine/magicsock: fix few remaining logs without package prefix
2020-03-23 22:11:49 -07:00
Brad Fitzpatrick
c473927558
wgengine/magicsock: clean up, add, improve DERP logs
2020-03-23 21:57:58 -07:00
Brad Fitzpatrick
e749377a56
derp/derphttp: remove a redundant log message
2020-03-23 21:23:36 -07:00
Brad Fitzpatrick
1d3f45f9be
derp/derphttp: ignore PeerGoneMessage in test
2020-03-23 14:13:49 -07:00
Brad Fitzpatrick
ea9310403d
wgengine/magicsock: re-STUN on DERP connection death
...
Fixes #201
2020-03-23 13:19:33 -07:00
Brad Fitzpatrick and 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 >
2020-03-22 21:00:47 -07:00
Brad Fitzpatrick
b6f77cc48d
wgengine/magicsock: return early, outdent in derpWriteChanOfAddr
2020-03-22 14:08:59 -07:00
Brad Fitzpatrick
8c4cef60f8
derp: wait for send goroutine to finish before returning from run
...
I saw a test flake due to the sender goroutine logging (ultimately to
t.Logf) after the server was closed.
This makes sure the all goroutines are cleaned up before Server.Close
returns.
2020-03-22 13:10:07 -07:00
Brad Fitzpatrick
521ad7b0fc
derp: only flush writes to clients when we're out of things to write
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-22 08:01:25 -07:00
Brad Fitzpatrick
0a25abcdaa
derp: remove TODO comment
...
It was done in bf704a5218
2020-03-22 07:54:50 -07:00
Brad Fitzpatrick
8519a1b29f
derp: revert rename of pkt to sendMsg
...
New plan, sorry.
Most reverts 77921a31b1 , except some doc changes.
2020-03-21 22:17:22 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
c34b350efa
derp: remove the mutex around and closing of send channel
...
Makes it less complicated.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-21 22:00:04 -07:00
Brad Fitzpatrick
77921a31b1
derp: rename pkt to sendMsg, in prep for other types of writes
...
Updates #150
2020-03-21 20:34:49 -07:00
Brad Fitzpatrick
1453aecb44
derp: add sclient.done channel, simplify some context passing
...
This is mostly prep for a few future CLs, making sure we always have a
close-on-dead done channel available to select on when doing other
channel operations.
2020-03-21 18:28:34 -07:00
Brad Fitzpatrick and Dave Anderson
fd824df1fa
derp: export metric for server's initial MemStats.Sys reading
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-20 15:37:36 -07:00
Brad Fitzpatrick
dd31285ad4
wgengine/magicsock: send IPv6 using pconn6, if available
...
In prep for IPv6 support. Nothing should make it this far yet.
2020-03-20 14:30:12 -07:00
Brad Fitzpatrick
af277a6762
controlclient, magicsock: add debug knob to request IPv6 endpoints
...
Add opt-in method to request IPv6 endpoints from the control plane.
For now they should just be skipped. A previous version of this CL was
unconditional and reportedly had problems that I can't reproduce. So
make it a knob until the mystery is solved.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-20 14:27:24 -07:00
Brad Fitzpatrick
221e7d7767
wgengine/magicsock: make log message include DERP port (node)
2020-03-20 13:51:20 -07:00
Brad Fitzpatrick
33bdcabf03
wgengine/magicsock: call stun callback w/ only valid part of STUN packet
2020-03-20 13:44:27 -07:00
Brad Fitzpatrick
f9cc4e8f53
tailcfg: restore MapRequest.IncludeIPv6 bool
...
Partially restores 0be475ba46
2020-03-20 08:13:47 -07:00
Brad Fitzpatrick
f9184ad12b
go.mod: update wireguard-go for https://github.com/tailscale/wireguard-go/pull/13
2020-03-19 22:46:36 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
94024355ed
tailcfg, controlclient, magicsock: request IPv6 endpoints, but ignore them
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-19 21:01:52 -07:00
Brad Fitzpatrick
51b669e4bd
ipn: skip tailscaled UDP ports in service list
2020-03-19 19:56:02 -07:00
Brad Fitzpatrick
60ea635c6d
wgengine/magicsock: delete inaccurate comment
...
I meant to include this in the earlier commit.
2020-03-19 19:48:02 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
a184e05290
wgengine/magicsock: listen on udp6, use it for STUN, report endpoint
...
More steps towards IPv6 transport.
We now send it to tailcontrol, which ignores it.
But it doesn't actually actually support IPv6 yet (outside of STUN).
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-19 13:54:38 -07:00
Brad Fitzpatrick
7caa288213
wgengine/magicsock: rename pconn field to pconn4, in prep for pconn6
2020-03-19 08:49:30 -07:00
Brad Fitzpatrick
5fa825f057
go.mod, go.sum: update
2020-03-19 08:49:12 -07:00
Brad Fitzpatrick
14a2564ef0
go.mod: bump wireguard-go
2020-03-18 13:26:08 -07:00
Brad Fitzpatrick
19a1704abd
netcheck: use best DERP server in past 5 minutes to avoid flip-flopping
...
Fixes #162
2020-03-18 13:07:13 -07:00
Brad Fitzpatrick
6de37f4cc0
tsweb: move some comments, add a TODO
2020-03-18 09:54:48 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
f8d67bb591
portlist: ignore ports bound to localhost
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-17 20:55:45 -07:00
Brad Fitzpatrick
c706731dc7
tsweb: add copyright header
...
And fix an unlikely but potential crash.
2020-03-17 20:08:13 -07:00
Brad Fitzpatrick
8f9fa6a842
logtail: minor style/simplification changes
2020-03-15 22:41:50 -07:00
Brad Fitzpatrick
8de67844bd
cmd/tailscale: make failure message when tailscaled down less technical
2020-03-15 22:40:41 -07:00
Brad Fitzpatrick
5aafe0ee96
cmd/tailscale: don't crash on too many non-flag args
2020-03-15 22:27:36 -07:00
Brad Fitzpatrick
d348b94505
stun, stunner: clarify an error log message more
...
But two earlier changes mean this doesn't show up anymore anyway.
But if it does, it'll be a nice message.
2020-03-15 22:19:45 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
120273d7f6
portlist: document, clean up, fix an open fd spike, optimize a bit
...
I noticed portlist when looking at some profiles and hadn't looked at
the code much before. This is a first pass over it. It allocates a
fair bit. More love remains, but this does a bit:
name old time/op new time/op delta
GetList-8 9.92ms ± 8% 9.64ms ±12% ~ (p=0.247 n=10+10)
name old alloc/op new alloc/op delta
GetList-8 931kB ± 0% 869kB ± 0% -6.70% (p=0.000 n=10+10)
name old allocs/op new allocs/op delta
GetList-8 4.59k ± 0% 3.69k ± 1% -19.71% (p=0.000 n=10+10)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-13 21:06:41 -07:00
Brad Fitzpatrick
6c3820e8c4
cmd/tailscaled: rename relaynode reference in defaults file comment
2020-03-13 14:38:04 -07:00
Brad Fitzpatrick
19cc4f8b8e
control/controlclient: remove a number literal in string slice offset
2020-03-13 09:48:15 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
db2436c7ff
wgengine/magicsock: don't interrupt endpoint updates, merge all mutex into one
...
Before, endpoint updates were constantly being interrupted and resumed
on Linux due to tons of LinkChange messages from over-zealous Linux
netlink messages (from router_linux.go)
Now that endpoint updates are fast and bounded in time anyway, just
let them run to completion, but note that another needs to be
scheduled after.
Now logs went from pages of noise to just:
root@taildoc:~# grep -i -E 'stun|endpoint update' log
2020/03/13 08:51:29 magicsock.Conn: starting endpoint update (initial)
2020/03/13 08:51:30 magicsock.Conn.ReSTUN: endpoint update active, need another later ("link-change-minor")
2020/03/13 08:51:31 magicsock.Conn: starting endpoint update (link-change-minor)
2020/03/13 08:51:31 magicsock.Conn.ReSTUN: endpoint update active, need another later ("link-change-minor")
2020/03/13 08:51:33 magicsock.Conn: starting endpoint update (link-change-minor)
2020/03/13 08:51:33 magicsock.Conn.ReSTUN: endpoint update active, need another later ("link-change-minor")
2020/03/13 08:51:35 magicsock.Conn: starting endpoint update (link-change-minor)
2020/03/13 08:51:35 magicsock.Conn.ReSTUN: endpoint update active, need another later ("link-change-minor")
Or, seen in another run:
2020/03/13 08:45:41 magicsock.Conn: starting endpoint update (periodic)
2020/03/13 08:46:09 magicsock.Conn: starting endpoint update (periodic)
2020/03/13 08:46:21 magicsock.Conn: starting endpoint update (link-change-major)
2020/03/13 08:46:37 magicsock.Conn: starting endpoint update (periodic)
2020/03/13 08:47:05 magicsock.Conn: starting endpoint update (periodic)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-13 09:34:11 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
db31550854
wgengine: don't Reconfig on boring link changes
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-13 07:45:59 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
b9c6d3ceb8
netcheck: work behind UDP-blocked networks again, add tests
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-12 14:49:06 -07:00
Brad Fitzpatrick
a87ee4168a
stunner: quiet a harmless log warning
2020-03-12 14:14:23 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
bc73dcf204
wgengine/magicsock: don't block in Send waiting for derphttp.Send
...
Fixes #137
Updates #109
Updates #162
Updates #163
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-12 12:19:12 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
8807913be9
wgengine/magicsock: wait for previous DERP goroutines to end before new ones
...
Updates #109 (hopefully fixes, will wait for graphs to be happy)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-12 12:19:12 -07:00
Brad Fitzpatrick
eff6dcdb4e
wgengine/magicsock: log more about why we're re-STUNing
2020-03-12 12:09:25 -07:00
Brad Fitzpatrick
52c0cb12fb
stunner: return wrapped error (currently unused)
2020-03-12 11:21:19 -07:00
Brad Fitzpatrick
b4d02a251a
syncs: add new package for extra sync types
2020-03-12 11:13:33 -07:00
Brad Fitzpatrick
afc3479d04
netcheck: fix data races for staggler STUN packets arriving after GetReport
...
Fixes #179
2020-03-11 15:35:12 -07:00
Brad Fitzpatrick
b3ddf51a15
wgengine/magicsock: add a pointer value for logging
...
Updates #109
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-11 15:12:19 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
0d3f42e1d8
netcheck: ignore IPv4 STUN failures if we saw at least one reply
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-11 13:57:23 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
ed7e088729
netcheck: ignore IPv6 STUN failures
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-11 12:44:59 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
4fd29349b9
derp: add clients_replaced counter
...
Updates #109
2020-03-11 11:55:43 -07:00
Brad Fitzpatrick
b0f8931d26
wgengine/magicsock: make a test signature a bit more explicit
2020-03-11 09:51:33 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
01b4bec33f
stunner: re-do how Stunner works
...
It used to make assumptions based on having Anycast IPs that are super
near. Now we're intentionally going to a bunch of different distant
IPs to measure latency.
Also, optimize how the hairpin detection works. No need to STUN on
that socket. Just use that separate socket for sending, once we know
the other UDP4 socket's endpoint. The trick is: make our test probe
also a STUN packet, so it fits through magicsock's existing STUN
routing.
This drops netcheck from ~5 seconds to ~250-500ms.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-11 08:08:48 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
023df9239e
Move linkstate boring change filtering to magicsock
...
So we can at least re-STUN on boring updates.
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-10 12:50:03 -07:00
Brad Fitzpatrick
5c1e443d34
wgengine/monitor: don't call LinkChange when interfaces look unchanged
...
Basically, don't trust the OS-level link monitor to only tell you
interesting things. Sanity check it.
Also, move the interfaces package into the net directory now that we
have it.
2020-03-10 11:03:19 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
39c0ae1dba
derp/derpmap: new DERP config package, merge netcheck into magicsock more
...
Fixes #153
Updates #162
Updates #163
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-10 10:37:25 -07:00
Brad Fitzpatrick
bd0e20f351
net/dnscache: ignore annoying staticcheck check
2020-03-09 22:12:22 -07:00
Brad Fitzpatrick
d44325295e
net/dnscache: initialize the single Resolver more directly
2020-03-09 21:05:01 -07:00
Brad Fitzpatrick
d07146aafb
go.mod, go.sum: update
2020-03-09 21:01:08 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
5d8001d0ad
derp: add varz for home moves
...
Updates #162
Updates #163 (maybe)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2020-03-09 11:09:27 -07:00