You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
David Anderson 05a52746a4 wgengine/magicsock: fix destination selection logic to work with DERP.
The effect is subtle: when we're not spraying packets, and have not yet
figured out a curAddr, and we're not spraying, we end up sending to
whatever the first IP is in the iteration order. In English, that
means "when we have no idea where to send packets, and we've given
up on sending to everyone, just send to the first addr we see in
the list."

This is, in general, what we want, because the addrs are in sorted
preference order, low to high, and DERP is the least preferred
destination. So, when we have no idea where to send, send to DERP,
right?

... Except for very historical reasons, appendDests iterated through
addresses in _reverse_ order, most preferred to least preferred.
crawshaw@ believes this was part of the earliest handshaking
algorithm magicsock had, where it slowly iterated through possible
destinations and poked handshakes to them one at a time.

Anyway, because of this historical reverse iteration, in the case
described above of "we have no idea where to send", the code would
end up sending to the _most_ preferred candidate address, rather
than the _least_ preferred. So when in doubt, we'd end up firing
packets into the blackhole of some LAN address that doesn't work,
and connectivity would not work.

This case only comes up if all your non-DERP connectivity options
have failed, so we more or less failed to detect it because we
didn't have a pathological test box deployed. Worse, codependent
bug 2839854994 made DERP accidentally
work sometimes anyway by incorrectly exploiting roamAddr behavior,
albeit at the cost of making DERP traffic symmetric. In fixing
DERP to once again be asymmetric, we effectively removed the
bandaid that was concealing this bug.

Signed-Off-By: David Anderson <danderson@tailscale.com>
6 years ago
.github Remove the explicit security redirect. 6 years ago
atomicfile Move Linux client & common packages into a public repo. 6 years ago
cmd netcheck: include two more DERP nodes, show more in CLI report 6 years ago
control/controlclient magicsock, wgengine, ipn, controlclient: plumb regular netchecks to map poll 6 years ago
derp derp: add some varz tests for active/home conns 6 years ago
interfaces magicsock, interfaces: move some code from magicsock to interfaces 6 years ago
ipn ipn, wgengine/magicsock: add ipn.Prefs.DisableDERP bool 6 years ago
logpolicy logpolicy: automatically figure out paths and filenames. 6 years ago
logtail logtail/filch: use x/sys/unix instead of syscall. 6 years ago
metrics metrics: add a LabelMap type for variables with 1 label dimension. 6 years ago
net/dnscache net/dnscache: add overly simplistic DNS cache package for selective use 6 years ago
netcheck net/dnscache: add overly simplistic DNS cache package for selective use 6 years ago
paths paths: use /var/db for state on BSDs, and /var/run for sockets. 6 years ago
portlist portlist: add a lint ignore for unused function. 6 years ago
ratelimit Move Linux client & common packages into a public repo. 6 years ago
safesocket safesocket: make some effort to create parent directory of sock 6 years ago
stun stun: add server support 6 years ago
stunner net/dnscache: add overly simplistic DNS cache package for selective use 6 years ago
tailcfg magicsock, wgengine, ipn, controlclient: plumb regular netchecks to map poll 6 years ago
tempfork/osexec Move Linux client & common packages into a public repo. 6 years ago
testy Move Linux client & common packages into a public repo. 6 years ago
tsweb tsweb: let expvar.Ints be gauges too 6 years ago
types types/key: add IsZero methods 6 years ago
version version: add IsMobile func 6 years ago
wgengine wgengine/magicsock: fix destination selection logic to work with DERP. 6 years ago
.gitattributes .gitattributes: add a smudge filter for go.mod. 6 years ago
.gitignore cmd/relaynode: drop local --acl-file in favour of central packet filter. 6 years ago
AUTHORS Move Linux client & common packages into a public repo. 6 years ago
CODE_OF_CONDUCT.md Add a code of conduct. 6 years ago
Dockerfile Dockerfile: install iptables in the container. 6 years ago
LICENSE Move Linux client & common packages into a public repo. 6 years ago
PATENTS Move Linux client & common packages into a public repo. 6 years ago
README.md Add a using section that points to pkgs.tailscale.com. 6 years ago
SECURITY.md Add a SECURITY.md for vulnerability reports. 6 years ago
go.mod go.mod: update wireguard-go version 6 years ago
go.sum go.sum: update 6 years ago

README.md

Tailscale

https://tailscale.com

Private WireGuard® networks made easy

Overview

This repository contains all the open source Tailscale code. It currently includes the Linux client.

The Linux client is currently cmd/relaynode, but will soon be replaced by cmd/tailscaled.

Using

We serve packages for a variety of distros at https://pkgs.tailscale.com .

Building

go install tailscale.com/cmd/tailscale{,d}

We only support the latest Go release and any Go beta or release candidate builds (currently Go 1.13.x or Go 1.14) in module mode. It might work in earlier Go versions or in GOPATH mode, but we're making no effort to keep those working.

Bugs

Please file any issues about this code or the hosted service on the issue tracker.

Contributing

under_construction.gif

PRs welcome, but we are still working out our contribution process and tooling.

We require Developer Certificate of Origin Signed-off-by lines in commits.

About Us

We are apenwarr, bradfitz, crawshaw, danderson, dfcarney, from Tailscale Inc. You can learn more about us from our website.

WireGuard is a registered trademark of Jason A. Donenfeld.