Commit Graph

64 Commits (1b42117791266251b41959fc18e6c6215a85f739)

Author SHA1 Message Date
kari-ts 1b42117791
use network callback to update DNS config when network changes (#147)
* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Fixes #10107

* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Updates tailscale/tailscale/#10107

hi

* hi

* .

* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Updates tailscale/tailscale/#10107

* fixed missing connectivity manager
5 months ago
Denton Gentry a965ae0038
cmd/tailscale: add tun Wrapper and call Start() (#140)
Fixes https://github.com/tailscale/corp/issues/15388

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
8 months ago
James Tucker 727e7e2b50 cmd/tailscale: avoid creating multiple netmon instances
This is a quick fix, we should come back and try to reorganize this
later.

Updates tailscale/tailscale#9374
9 months ago
Aaron Klotz 6a142b2f50 cmd/tailscale: fix OSS build breaks
For build #cleanup

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
9 months ago
Brad Fitzpatrick b500bbdad6 go.mod: bump oss
And resulting API changes.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
9 months ago
James Tucker 6a6e80db47
go.mod,cmd/tailscale: bump OSS and update logtail transport setup (#119)
Updates #cleanup
10 months ago
Brad Fitzpatrick 6b9a11c755 cmd/tailscale: fix regression from earlier commit
In 00a42702cb I bumped go.mod and adjusted the API, but only tested
that it compiled & tests (hah) passed.

I forgot this line. I still haven't tested this, but can't be worse! :)

Fixes 00a42702cb (commitcomment-112642284)

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 year ago
Brad Fitzpatrick 00a42702cb go.mod: bump tailscale.com dep, update for tsd.System API change
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 year ago
Brad Fitzpatrick a7b3ae04b0 cmd/tailscale: use Google as DNS of last resort
Sometimes we try a dozen different ways to read the phone's DNS
settings and it still comes back empty. In that case, if we're already
on a Google-ified Android phone, just use Google's Public DNS servers
as the ultimate fallback, as we already do on ChromeOS to work around
ChromeOS Android VpnBuilder bugs.

Updates tailscale/tailscale#8006 etc etc

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 year ago
Denton Gentry aa32919ac3 go.mod: update from OSS
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 year ago
Mihai Parparita 8e4a740d8e cmd/tailscale: enabled logtail flushing for the Android client
The c2n endpoint was not working since we did not configure the flush
function (same issue that was previously fixed in the iOS client in
tailscale/corp#9939).

Updates tailscale/corp#8564
1 year ago
Mihai Parparita 68ecc44a49 cmd/tailscale: upload client metrics
More generally, make the logtail.Config similar to the one used by
clients for other platforms.

Updates tailscale/corp#9230
1 year ago
Jordan Whited 2470284b31
go.mod: Update from OSS and bump wireguard-go. (#88)
Signed-off-by: Jordan Whited <jordan@tailscale.com>
1 year ago
Denton Gentry d53da4ac65 go.mod: update OSS
Skip over the build number used for 1.36.2.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 year ago
David Anderson 52a0509a5d go.mod: update to tailscale HEAD
And update build logic to account for the API change in
tailscale.com/version.

And apply the API change introduced by
tailscale/tailscale@04b57a371e

Signed-off-by: David Anderson <dave@natulte.net>
1 year ago
Denton Gentry 6f1567bac8 go.mod: update from OSS.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 year ago
Denton Gentry 30e46fb854
go.mod: update from OSS. (#74)
Signed-off-by: Denton Gentry <dgentry@tailscale.com>

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 year ago
James Tucker 73e3a13322
cmd/tailscale: implement new batch APIs (#71)
Signed-off-by: Jordan Whited <jordan@tailscale.com>
1 year ago
Denton Gentry 1181155b7d go.mod: update from OSS.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Denton Gentry d46d247535
cmd/tailscale: set logcfg.FlushDelay (#67)
Signed-off-by: Denton Gentry <dgentry@tailscale.com>

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Denton Gentry 98b7c9d7e5 backend: logcfg.DrainLogs is now the default
We don't need to implement a 2 minute timer.

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Andrew Dunham 576b46f8f7
cmd/tailscale: show an error when we hit the multiple users Android bug (#65)
Updates tailscale/tailscale#2180

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
2 years ago
Trevor Bergeron d8aedf721a Add ability to choose a custom coordination server
Signed-off-by: Trevor Bergeron <mal@sec.gd>
2 years ago
Brad Fitzpatrick f77610bd62 reformat, rename googleDNSServers variable
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2 years ago
Denton Gentry 1a0253892b go.mod: update from OSS.
Includes netaddr -> netip changes.

main.go getInterfaces still uses netaddr as it needs to return
a net.IPNet (we'd need to add a new implementation in
7c671b0220/net/interfaces/interfaces.go (L110)
to handle a different type).

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Denton Gentry 7697c9d300 go.mod: update OSS to main@HEAD.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Brad Fitzpatrick cff9e2a772 cmd/tailscale: fix netstack init, call SetLocalBackend
The netstack code on Android was never told about the LocalBackend,
so the peerapi interception wasn't working.

Fixes tailscale/tailscale#4449
Fixes tailscale/tailscale#4293

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2 years ago
Denton Gentry 5868fdb7b0 go.mod: update OSS from HEAD.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Brad Fitzpatrick 9d801a42d7 Add secret Run Exit Node option when "debug" is searched for.
And bump tailscale dep, to bring in new ipn.Prefs API and wire up
ExitDNS for Android.

This change has no visible behavior change to anybody unless they
search for "debug" and then hit the "..." menu.

Updates tailscale/tailscale#1738

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2 years ago
Brad Fitzpatrick ed29f4b3d2 cmd/tailscale: add "Bug report" item to menu
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2 years ago
Denton Gentry 184250167b
Merge branch 'main' into dns 3 years ago
Denton Gentry ca696b116c Update opensource repository 3 years ago
Denton Gentry 5c9cec0064 retrieve current DNS servers.
Add getDnsConfigAsString() to retrieve the current DNS
configuration from the Android platform. This implements
several mechanisms to retrieve DNS information, suitable
for different Android versions:

Android 7 and later use ConnectivityManager getAllNetworks(),
then iterate over each network to retrieve DNS servers and
search domains using the LinkProperties.

Android 6 and earlier can only retrieve the currently active
interface using ConnectivityManager getActiveNetwork(), but have
two additional fallback options which leverage the system
properties available in older Android releases.

--------

Also changed how LinkChange notification works, switching from
the older BroadcastReceiver of a ConnectivityManager Intent to
the newer ConnectivityManager.registerNetworkCallback. We need
this because the onAvailable event is too early, we get notified
that LTE is up before its DNS servers have been set. We need
to wait for the onLinkPropertiesChanged event instead, which is
only available with registerNetworkCallback.

Fixes https://github.com/tailscale/tailscale/issues/2116
Updates https://github.com/tailscale/tailscale/issues/988

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Denton Gentry 729bf9a356 backend: use logpolicy.NewLogtailTransport
Allows use of bootstrap DNS and of a built-in ISRG X1 root
certificate.

Fixes https://github.com/tailscale/tailscale/issues/3046
3 years ago
Brad Fitzpatrick d0b4a09e59 fix name of NewUserspaceEngine in error/comment
It was renamed some time ago.
3 years ago
Brad Fitzpatrick ac8ec020b8 Update to Tailscale 1.10.
Updates tailscale/tailscale#2102
Updates tailscale/tailscale#1809
3 years ago
Denton Gentry 90351e7392 backend: Send DNS config through CallbackRouter.
Using NewNoopManager avoided the errors from trying to overwrite
/etc/resolv.conf, but still didn't fully work. Route DNS config
through the CallbackRouter.

Fixes https://github.com/tailscale/tailscale/issues/1956

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Elias Naur 9ba4a01a4e cmd/tailscale: remove tstun.Wrapper
NewUserspaceEngine wraps our TUN device already.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Denton Gentry ec8133a972 backend: use dns.NewNoopManager.
Android updates its DNS config in updateTUN() when in response
to several different channels from the backend.

There is not an Android-specific NewOSConfigurator, we end
up pulling in the Linux NewOSConfigurator:
https://github.com/tailscale/tailscale/blob/main/net/dns/manager_linux.go

The Linux DNS manager expects to be able to write to /etc/resolv.conf,
which does not work on Android and causes errors in updating DNS config.

Instead, allocate dns.NewNoopManager to disable the DNS manager, and
rely on the updateTUN() code to handle DNS.

Fixes https://github.com/tailscale/tailscale/issues/1956

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Elias Naur 06e461d703 go.*,cmd/tailscale: upgrade to tailscale.com v1.8.3
Updates tailscale/tailscale#1695

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 05212e770b cmd/tailscale: don't configure logtail for low memory
logtail in low memory configuration truncates log lines to ~254 bytes.

Fixes tailscale/tailscale#1625

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 56362cc61a cmd/tailscale,go.*: upgrade to latest tailscale
Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur ba38a9bb59 jni,cmd/tailscale: replace jni.EnvFor with explicit conversion
The EnvFor converted an uintptr to a pointer value, which is not
guaranteed to work in general. This change removes EnvFor and pushes the
potentially unsafe conversion to users of the jni package.

Fixes tailscale/tailscale#1195

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 61d9733b24 jni,cmd/tailscale: replace jni.JVMFor with direct cast
The JVMFor function converted an uintptr to a pointer, which is not
guaranteed to work in general. This change removes JVMFor, forcing the
unsafe conversion to the user of the jni packge.

Updates tailscale/tailscale#1195

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
David Anderson b1395cfefb cmd/tailscale: update to network engine that supports IPv6.
Part of tailscale/tailscale#1158.

Signed-off-by: David Anderson <danderson@tailscale.com>
3 years ago
Elias Naur 33a953fb21 cmd/tailscale: only refresh VPN tunnel if configuration changed
This used to work, but a later ChromeOS workaround closed and cleared the last
configuration before comparing it with the new.

Fixes tailscale/tailscale#966

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 25168130a7 cmd/tailscale,go.*: update to tailscale 1.2
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 1003774193 cmd/tailscale,go.*: fix network hangs on Huawei devices
Bump the tailscale.com module version to get the Android fallback
for determining the default network device,

25b021388b

Updates tailscale/tailscale#471

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 758e5691da cmd/tailscale: mask route addresses to please VpnService.Builder.addRoute
Update inet.af/netaddr for IPPrefix.Masked.

Fixes tailscale/tailscale#645

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 454c59a4e5 cmd/tailscale: add detail to VpnService.Builder cosntruction errors
Updates tailscale/tailscale#645

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago