summaryrefslogtreecommitdiffhomepage
path: root/net/dns/nm.go
AgeCommit message (Collapse)AuthorFilesLines
2026-01-23all: remove AUTHORS file and references to itWill Norris1-1/+1
This file was never truly necessary and has never actually been used in the history of Tailscale's open source releases. A Brief History of AUTHORS files --- The AUTHORS file was a pattern developed at Google, originally for Chromium, then adopted by Go and a bunch of other projects. The problem was that Chromium originally had a copyright line only recognizing Google as the copyright holder. Because Google (and most open source projects) do not require copyright assignemnt for contributions, each contributor maintains their copyright. Some large corporate contributors then tried to add their own name to the copyright line in the LICENSE file or in file headers. This quickly becomes unwieldy, and puts a tremendous burden on anyone building on top of Chromium, since the license requires that they keep all copyright lines intact. The compromise was to create an AUTHORS file that would list all of the copyright holders. The LICENSE file and source file headers would then include that list by reference, listing the copyright holder as "The Chromium Authors". This also become cumbersome to simply keep the file up to date with a high rate of new contributors. Plus it's not always obvious who the copyright holder is. Sometimes it is the individual making the contribution, but many times it may be their employer. There is no way for the proejct maintainer to know. Eventually, Google changed their policy to no longer recommend trying to keep the AUTHORS file up to date proactively, and instead to only add to it when requested: https://opensource.google/docs/releasing/authors. They are also clear that: > Adding contributors to the AUTHORS file is entirely within the > project's discretion and has no implications for copyright ownership. It was primarily added to appease a small number of large contributors that insisted that they be recognized as copyright holders (which was entirely their right to do). But it's not truly necessary, and not even the most accurate way of identifying contributors and/or copyright holders. In practice, we've never added anyone to our AUTHORS file. It only lists Tailscale, so it's not really serving any purpose. It also causes confusion because Tailscalars put the "Tailscale Inc & AUTHORS" header in other open source repos which don't actually have an AUTHORS file, so it's ambiguous what that means. Instead, we just acknowledge that the contributors to Tailscale (whoever they are) are copyright holders for their individual contributions. We also have the benefit of using the DCO (developercertificate.org) which provides some additional certification of their right to make the contribution. The source file changes were purely mechanical with: git ls-files | xargs sed -i -e 's/\(Tailscale Inc &\) AUTHORS/\1 contributors/g' Updates #cleanup Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
2025-09-24net/dns, feature/featuretags: make NetworkManager, systemd-resolved, and ↵Brad Fitzpatrick1-9/+54
DBus modular Saves 360 KB (19951800 => 19591352 on linux/amd64 --extra-small --box binary) Updates #12614 Updates #17206 Change-Id: Iafd5b2536dd735111b447546cba335a7a64379ed Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-05-07net/dns: don't link dbus, gonotify on AndroidBrad Fitzpatrick1-1/+1
Android is Linux, but doesn't use Linux DNS managers (or D-Bus). Updates #12614 Change-Id: I487802ac74a259cd5d2480ac26f7faa17ca8d1c3 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-01-13all: use Go 1.21's binary.NativeEndianBrad Fitzpatrick1-2/+2
We still use josharian/native (hi @josharian!) via netlink, but I also sent https://github.com/mdlayher/netlink/pull/220 Updates #8632 Change-Id: I2eedcb7facb36ec894aee7f152c8a1f56d7fc8ba Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-12-21all: cleanup unused code, part 2 (#10670)Andrew Lytvynov1-0/+7
And enable U1000 check in staticcheck. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-08-29net/{interfaces,netmon}: remove "interesting", EqualFiltered APIBrad Fitzpatrick1-8/+13
This removes a lot of API from net/interfaces (including all the filter types, EqualFiltered, active Tailscale interface func, etc) and moves the "major" change detection to net/netmon which knows more about the world and the previous/new states. Updates #9040 Change-Id: I7fe66a23039c6347ae5458745b709e7ebdcce245 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-12-12util/endian: delete package; use updated josharian/native insteadBrad Fitzpatrick1-2/+2
See josharian/native#3 Updates golang/go#57237 Change-Id: I238c04c6654e5b9e7d9cfb81a7bbc5e1043a84a2 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-11-04all: remove old +build tagsBrad Fitzpatrick1-1/+0
The //go:build syntax was introduced in Go 1.17: https://go.dev/doc/go1.17#build-lines gofmt has kept the +build and go:build lines in sync since then, but enough time has passed. Time to remove them. Done with: perl -i -npe 's,^// \+build.*\n,,' $(git grep -l -F '+build') Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-09-29all: fix spelling mistakesJosh Soref1-1/+1
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-25all: convert more code to use net/netip directlyBrad Fitzpatrick1-3/+2
perl -i -npe 's,netaddr.IPPrefixFrom,netip.PrefixFrom,' $(git grep -l -F netaddr.) perl -i -npe 's,netaddr.IPPortFrom,netip.AddrPortFrom,' $(git grep -l -F netaddr. ) perl -i -npe 's,netaddr.IPPrefix,netip.Prefix,g' $(git grep -l -F netaddr. ) perl -i -npe 's,netaddr.IPPort,netip.AddrPort,g' $(git grep -l -F netaddr. ) perl -i -npe 's,netaddr.IP\b,netip.Addr,g' $(git grep -l -F netaddr. ) perl -i -npe 's,netaddr.IPv6Raw\b,netip.AddrFrom16,g' $(git grep -l -F netaddr. ) goimports -w . Then delete some stuff from the net/netaddr shim package which is no longer neeed. Updates #5162 Change-Id: Ia7a86893fe21c7e3ee1ec823e8aba288d4566cd8 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-07-25all: use various net/netip parse funcs directlyBrad Fitzpatrick1-1/+2
Mechanical change with perl+goimports. Changed {Must,}Parse{IP,IPPrefix,IPPort} to their netip variants, then goimports -d . Finally, removed the net/netaddr wrappers, to prevent future use. Updates #5162 Change-Id: I59c0e38b5fbca5a935d701645789cddf3d7863ad Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-07-25net/netaddr: start migrating to net/netip via new netaddr adapter packageBrad Fitzpatrick1-1/+1
Updates #5162 Change-Id: Id7bdec303b25471f69d542f8ce43805328d56c12 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-03-17all: use any instead of interface{}Josh Bleecher Snyder1-2/+2
My favorite part of generics. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-08-05all: gofmt with Go 1.17Josh Bleecher Snyder1-0/+1
This adds "//go:build" lines and tidies up existing "// +build" lines. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-06-18staticcheck.conf: turn off noisy lint errorsDavid Crawshaw1-2/+0
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2021-05-06Revert "net/dns: set IPv4 auto mode in NM, so it lets us set DNS."David Anderson1-22/+12
This reverts commit 7d16c8228bcf70a3b82afe994e8c5fa42057c5f3. I have no idea how I ended up here. The bug I was fixing with this change fails to reproduce on Ubuntu 18.04 now, and this change definitely does break 20.04, 20.10, and Debian Buster. So, until we can reliably reproduce the problem this was meant to fix, reverting. Part of #1875 Signed-off-by: David Anderson <dave@natulte.net>
2021-05-06net/dns: log the correct error when NM Reapply fails.David Anderson1-1/+1
Found while debugging #1870. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-05-06net/dns: set IPv4 auto mode in NM, so it lets us set DNS.David Anderson1-12/+22
Part of #1870. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-05-06net/dns: don't try to configure LLMNR or mdns in NetworkManager.David Anderson1-3/+6
Fixes #1870. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-29net/dns: stop NetworkManager breaking v6 connectivity when setting DNS.David Anderson1-0/+20
Tentative fix for #1699 Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-20net/dns: correctly capture all traffic in non-split configs.David Anderson1-2/+23
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-13net/dns: fix staticheck.David Anderson1-43/+0
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-13net/dns: implement correct manager detection on linux.David Anderson1-0/+9
Part of #953. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-13net/dns: fix NM's GetBaseConfig when no configs exist.David Anderson1-0/+4
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-12net/dns: return error from NewOSManager, use it to initialize NM.David Anderson1-29/+28
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-12net/dns: support split and unsplit DNS in NetworkManager.David Anderson1-2/+124
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-11net/dns: fix up NetworkManager configurator a bit.David Anderson1-26/+36
Clear LLMNR and mdns flags, update reasoning for our settings, and set our override priority harder than before when we want to be primary resolver. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-11net/dns: improve NetworkManager detection, using more DBus.David Anderson1-7/+33
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-07net/dns: some post-review cleanups.David Anderson1-2/+1
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-07net/dns: add GetBaseConfig to OSConfigurator interface.David Anderson1-0/+5
Part of #953, required to make split DNS work on more basic platforms. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-06net/dns: split out search domains and match domains in OSConfig.David Anderson1-2/+2
It seems that all the setups that support split DNS understand this distinction, and it's an important one when translating high-level configuration. Part of #953. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-05net/dns: add a Primary field to OSConfig.David Anderson1-1/+1
Currently ignored. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-05net/dns: rename Set to SetDNS in OSConfigurator.David Anderson1-2/+2
wgengine/router.CallbackRouter needs to support both the Router and OSConfigurator interfaces, so the setters can't both be called Set. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-02net/dns: disable NetworkManager and resolved configurators temporarily.David Anderson1-0/+2
They need some rework to do the right thing, in the meantime the direct and resolvconf managers will work out. The resolved implementation was never selected due to control-side settings. The networkmanager implementation mostly doesn't get selected due to unforeseen interactions with `resolvconf` on many platforms. Both implementations also need rework to support the various routing modes they're capable of. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-02net/dns: replace managerImpl with OSConfigurator in code.David Anderson1-6/+6
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-02net/dns: rename Config to OSConfig.David Anderson1-2/+2
Making way for a new higher level config struct. Signed-off-by: David Anderson <danderson@tailscale.com>
2021-04-01net/dns: remove ManagerConfig, pass relevant args directly.David Anderson1-2/+2
Signed-off-by: David Anderson <danderson@tailscale.com>
2021-03-25wgengine/router/dns: move to net/dns.David Anderson1-0/+205
Preparation for merging the APIs and whatnot. Signed-off-by: David Anderson <danderson@tailscale.com>