Brad Fitzpatrick and Brad Fitzpatrick
a12aad6b47
all: convert more code to use net/netip directly
...
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-25 21:53:49 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
6a396731eb
all: use various net/netip parse funcs directly
...
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-25 21:12:28 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
7eaf5e509f
net/netaddr: start migrating to net/netip via new netaddr adapter package
...
Updates #5162
Change-Id: Id7bdec303b25471f69d542f8ce43805328d56c12
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2022-07-25 16:20:43 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
f4f76eb275
net/dnsfallback: update from 'go generate'
...
Change-Id: I93e0e6d9a4a471953c1ffef07f32605c5724aed8
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2022-04-17 10:06:09 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
a49d8d5200
Revert ".github/workflows: work around golang/go#51629"
...
This reverts commit 2a412ac9ee .
Updates #4194
Change-Id: I0098b66b71d20bea301ca79058c1cdd201237dd0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2022-04-13 14:27:01 -07:00
Maisem Ali and Maisem Ali
b2f269d5b7
net/dnsfallback: do not attempt lookups of IPs.
...
Currently if the passed in host is an IP, Lookup still attempts to
resolve it with a dns server. This makes it just return the IP directly.
Updates tailscale/corp#4475
Signed-off-by: Maisem Ali <maisem@tailscale.com >
2022-03-24 22:43:01 -07:00
David Anderson and Dave Anderson
2a412ac9ee
.github/workflows: work around golang/go#51629
...
Incidentally, simplify the go generate CI workflow, by
marking the dnsfallback update non-hermetic (so CI will
skip it) rather than manually filter it out of `go list`.
Updates #4194
Signed-off-by: David Anderson <danderson@tailscale.com >
2022-03-17 17:22:17 -07:00
Josh Bleecher Snyder and Josh Bleecher Snyder
758c37b83d
net/netns: thread logf into control functions
...
So that darwin can log there without panicking during tests.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com >
2021-11-18 15:09:51 -08:00
Joe Tsai and Brad Fitzpatrick
9af27ba829
cmd/cloner: mangle "go:generate" in cloner.go
...
The "go generate" command blindly looks for "//go:generate" anywhere
in the file regardless of whether it is truly a comment.
Prevent this false positive in cloner.go by mangling the string
to look less like "//go:generate".
Signed-off-by: Joe Tsai <joetsai@digital-static.net >
2021-10-16 17:53:43 -07:00
Brad Fitzpatrick and Brad Fitzpatrick
7cf8ec8108
net/tlsdial: bake in LetsEncrypt's ISRG Root X1 root
...
We still try the host's x509 roots first, but if that fails (like if
the host is old), we fall back to using LetsEncrypt's root and
retrying with that.
tlsdial was used in the three main places: logs, control, DERP. But it
was missing in dnsfallback. So added it there too, so we can run fine
now on a machine with no DNS config and no root CAs configured.
Also, move SSLKEYLOGFILE support out of DERP. tlsdial is the logical place
for that support.
Fixes #1609
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-10-01 08:30:07 -07:00
David Anderson and Dave Anderson
4cf63b8df0
net/dnsfallback: update static map for new derp11.
...
Signed-off-by: David Anderson <danderson@tailscale.com >
2021-09-22 15:35:42 -07:00
Brad Fitzpatrick
5a58fd8933
net/dnsfallback: go generate, pick up new DERPs
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-09-05 17:46:34 -07:00
David Anderson and Dave Anderson
69c897a763
net/dnsfallback: run go generate to pick up new derp9s.
...
Signed-off-by: David Anderson <danderson@tailscale.com >
2021-09-05 00:00:16 -07:00
Josh Bleecher Snyder and Josh Bleecher Snyder
a5da4ed981
all: gofmt with Go 1.17
...
This adds "//go:build" lines and tidies up existing "// +build" lines.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com >
2021-08-05 15:54:00 -07:00
Brad Fitzpatrick
5a7ff2b231
net/dnsfallback: re-run go generate
2021-08-01 19:14:33 -07:00
Brad Fitzpatrick
b6179b9e83
net/dnsfallback: add new nodes
...
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-07-29 10:50:49 -07:00
Josh Bleecher Snyder and Josh Bleecher Snyder
84a6dcd9a9
net/dnsfallback: regenerate
...
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com >
2021-07-19 15:31:56 -07:00
David Crawshaw and David Crawshaw
d6f4b5f5cb
ipn, etc: use controlplane.tailscale.com
...
Signed-off-by: David Crawshaw <crawshaw@tailscale.com >
2021-06-28 09:38:23 -07:00
Brad Fitzpatrick
10d7c2583c
net/dnsfallback: don't depend on derpmap.Prod
...
Move derpmap.Prod to a static JSON file (go:generate'd) instead,
to make its role explicit. And add a TODO about making dnsfallback
use an update-over-time DERP map file instead of a baked-in one.
Updates #1264
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-06-27 22:07:40 -07:00
Brad Fitzpatrick
d37b3b02cd
net/dnsfallback: fix infinite loop and limit number of candidates
...
Updates #1455 (fixes the DNS spin part, but other things aren't ideal there)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-03-04 19:19:40 -08:00
Brad Fitzpatrick and Brad Fitzpatrick
9df4185c94
control/controlclient, net/{dnscache,dnsfallback}: add DNS fallback mechanism
...
Updates #1405
Updates #1403
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com >
2021-03-01 18:42:03 -08:00