summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient/netmap.go
AgeCommit message (Collapse)AuthorFilesLines
2021-01-14all: convert from []wgcfg.Endpoint to stringJosh Bleecher Snyder1-4/+7
This eliminates a dependency on wgcfg.Endpoint, as part of the effort to eliminate our wireguard-go fork. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-01-11ipn: only send services in Hostinfo if Tailnet has opted-in to services ↵Sonia Appasamy1-0/+6
collection (#1107) Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2021-01-10cmd/tailscale: change formatting of "tailscale status"Brad Fitzpatrick1-1/+25
* show DNS name over hostname, removing domain's common MagicDNS suffix. only show hostname if there's no DNS name. but still show shared devices' MagicDNS FQDN. * remove nerdy low-level details by default: endpoints, DERP relay, public key. They're available in JSON mode still for those who need them. * only show endpoint or DERP relay when it's active with the goal of making debugging easier. (so it's easier for users to understand what's happening) The asterisks are gone. * remove Tx/Rx numbers by default for idle peers; only show them when there's traffic. * include peers' owner login names * add CLI option to not show peers (matching --self=true, --peers= also defaults to true) * sort by DNS/host name, not public key * reorder columns
2020-12-30wgkey: new packageJosh Bleecher Snyder1-2/+3
This is a replacement for the key-related parts of the wireguard-go wgcfg package. This is almost a straight copy/paste from the wgcfg package. I have slightly changed some of the exported functions and types to avoid stutter, added and tweaked some comments, and removed some now-unused code. To avoid having wireguard-go depend on this new package, wgcfg will keep its key types. We translate into and out of those types at the last minute. These few remaining uses will be eliminated alongside the rest of the wgcfg package. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2020-12-28all: replace wgcfg.IP and wgcfg.CIDR with netaddr typesJosh Bleecher Snyder1-12/+7
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2020-12-21all: annotate log verbosity levels on most egregiously spammy log printsBrad Fitzpatrick1-2/+2
Fixes #924 Fixes #282 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-11-09wgengine/filter: remove the Matches type.David Anderson1-1/+1
It only served to obscure the underlying slice type without adding much value. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-10-27control/controlclient: also log active account in netmapsBrad Fitzpatrick1-0/+10
Updates tailscale/corp#461
2020-10-01control/controlclient, ipn: store machine key separately from user prefs/persistBrad Fitzpatrick1-0/+1
Updates #610 (fixes after some win/xcode changes in a separate repo)
2020-09-30Revert "all: keep UserProfiles a slice instead of a map for longer"Brad Fitzpatrick1-3/+5
This reverts commit e5894aba427cf3736039ac9e2369daffff7d0041. Breaks macOS/iOS build. Reverting per chat with Josh; he'll fix later today.
2020-09-29all: keep UserProfiles a slice instead of a map for longerJosh Bleecher Snyder1-5/+3
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2020-09-29control/controlclient: remove Roles fields from clientJosh Bleecher Snyder1-1/+0
They are unused. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2020-09-15control/controlclient: don't accept /32 routes without --accept-routesBrad Fitzpatrick1-1/+24
Fixes tailscale/corp#500 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-09-14net/netns: add windows support.David Anderson1-5/+0
Also remove rebinding logic from the windows router. Magicsock will instead rebind based on link change signals. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-08-06control/controlclient: remove unused NetworkMap.UAPI methodBrad Fitzpatrick1-15/+0
And remove last remaining use of wgcfg.ToUAPI in a test's debug output; replace it with JSON.
2020-08-03control/controlclient: print disco keys NetworkMap diffs (debug change only)Brad Fitzpatrick1-2/+9
NetworkMap text diffs being empty were currently used to short-circuit calling magicsock's SetNetworkMap (via Engine.SetNetworkMap), but that went away in c7582dc2 (0.100.0-230) Prior to c7582dc2 (notably, in 0.100.0-225 and below, down to 0.100.0), a change in only disco key (as when a node restarts) but without endpoint changes (as would happen for a client not behind a NAT with random ports) could result in a "netmap diff: (none)" being printed, as well as Engine.SetNetworkMap being skipped, leading to broken discovery endpoints. c7582dc2 fixed the Engine.SetNetworkMap skippage. This change fixes the "netmap diff: (none)" print so we'll actually see when a peer restarts with identical endpoints but a new discovery key.
2020-07-31all: dns refactor, add Proxied and PerDomain flags from control (#615)Dmytro Shynkevych1-6/+4
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-28ipn: fix netmap change tracking and dns map generation (#609)Dmytro Shynkevych1-3/+5
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-25control/controlclient: remove unused, slow, often-not-what-you-want ↵Brad Fitzpatrick1-21/+0
NetworkMap.Equal
2020-07-23control/controlclient: rewrite, test NetworkMap.ConciseDiffFromBrad Fitzpatrick1-52/+144
It stood out a lot in hello.ipn.dev's profiles for generating a lot of garbage (and thus GC CPU).
2020-07-23control/controlclient: rename uflags, give it a type, remove dead codeBrad Fitzpatrick1-29/+15
2020-07-23control/controlclient: generate wireguard config w/o WgQuick text indirectionBrad Fitzpatrick1-66/+53
2020-06-29wgengine/magicsock: add new endpoint type used for discovery-supporting peersBrad Fitzpatrick1-18/+29
This adds a new magicsock endpoint type only used when both sides support discovery (that is, are advertising a discovery key). Otherwise the old code is used. So far the new code only communicates over DERP as proof that the new code paths are wired up. None of the actually discovery messaging is implemented yet. Support for discovery (generating and advertising a key) are still behind an environment variable for now. Updates #483
2020-06-25control/controlclient: add Debug field to NetworkMapBrad Fitzpatrick1-3/+14
As part of disabling background STUN packets when idle, we want an emergency override switch to turn it back on, in case it interacts poorly in the wild. We'll send that via control, but we'll want to plumb it down to magicsock via NetworkMap. Updates tailscale/corp#320 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-06-24control/controlclient: cut down some NetworkMap stringification & diff ↵Brad Fitzpatrick1-3/+9
allocations And start of tests.
2020-06-24control/controlclient: trim /32 suffix a bit more succinctlyBrad Fitzpatrick1-4/+1
2020-06-18control/controlclient: make netmap generation use rate-limited logger.David Anderson1-8/+9
2020-06-18control/controlclient: delete unused function.David Anderson1-8/+0
2020-05-23all: make client use server-provided DERP map, add DERP region supportBrad Fitzpatrick1-0/+4
Instead of hard-coding the DERP map (except for cmd/tailscale netcheck for now), get it from the control server at runtime. And make the DERP map support multiple nodes per region with clients picking the first one that's available. (The server will balance the order presented to clients for load balancing) This deletes the stunner package, merging it into the netcheck package instead, to minimize all the config hooks that would've been required. Also fix some test flakes & races. Fixes #387 (Don't hard-code the DERP map) Updates #388 (Add DERP region support) Fixes #399 (wgengine: flaky tests) Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-03-25cmd/relaynode: delete it!Avery Pennarun1-51/+0
tailscale+tailscaled now completely obsoletes relaynode, so let's let it finally go away.
2020-03-24control/controlclient: add TODO to delete the UAPI methodBrad Fitzpatrick1-0/+2
2020-03-19control/controlclient: don't use Node as value typeBrad Fitzpatrick1-1/+1
2020-03-19tailcfg, controlclient: standardize on wgcfg ShortString key printingDavid Crawshaw1-15/+6
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-03-14controlclient: use per-peer KeepAlive signalDavid Crawshaw1-3/+1
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-03-13control/controlclient: remove a number literal in string slice offsetBrad Fitzpatrick1-2/+3
2020-03-12Fix staticcheck complaint.Avery Pennarun1-1/+1
2020-03-12controlclient/netmap: write our own b.ConciseDiffFrom(a) function.Avery Pennarun1-0/+28
This removes the need for go-cmp, which is extremely bloaty so we had to leave it out of iOS. As a result, we had also left it out of macOS, and so we didn't print netmap diffs at all on darwin-based platforms. Oops. As a bonus, the output format of the new function is way better. Minor oddity: because I used the dumbest possible diff algorithm, the sort order is a bit dumb. We print all "removed" lines and then print all "added" lines, rather than doing the usual diff-like thing of interspersing them. This probably doesn't matter (maybe it's an improvement).
2020-03-12controlclient: reformat netmap.Concise() and add DERP server info.Avery Pennarun1-10/+29
The .Concise() view had grown hard to read over time. Originally, we assumed a peer almost always had just one endpoint and one-or-more allowedips. With magicsock, we now almost always have multiple endpoints per peer. And empirically, almost every peer has only one allowedip. Change their order so we can line up allowedips vertically. Also do some tweaking to make multiple endpoints easier to read. While we're here, add a column to show the home DERP server of each peer, if any.
2020-03-02controlclient, tailcfg: deliver DERP addresses in a separate fieldDavid Crawshaw1-6/+11
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>
2020-03-02version: add IsMobile funcBrad Fitzpatrick1-5/+3
And use it control/controlclient.
2020-02-10controlclient: remove unused function.David Anderson1-7/+0
Signed-off-by: David Anderson <dave@natulte.net>
2020-02-09Move Linux client & common packages into a public repo.Earl Lee1-0/+294