Skip to content

Fix missing Allow LAN access toggle #735

Open
Pawloland wants to merge 1 commit intotailscale:mainfrom
Pawloland:lan_access_fix
Open

Fix missing Allow LAN access toggle #735
Pawloland wants to merge 1 commit intotailscale:mainfrom
Pawloland:lan_access_fix

Conversation

@Pawloland
Copy link

@Pawloland Pawloland commented Feb 6, 2026

Fix missing Allow LAN access toggle when exit node is activated for all devices older than android 13 - API 33.
Instead of relying on android SDK, manually calculate required ranges.
Fixes tailscale/tailscale#16187

…der than android 13 - API 33

Signed-off-by: Pawloland <59684145+Pawloland@users.noreply.github.com>
@Pawloland
Copy link
Author

@kari-ts @barnstar @nickoneill @bradfitz,
Hello, obligatory sorry for ping! It's been a while, and I am not sure if the issuebot is holding my PR back from your review. I linked the issue I found and fixed it. Could you review it? Thanks :)

@kari-ts
Copy link
Collaborator

kari-ts commented Feb 13, 2026

Some initial thoughts:
-can we still use ExcludeRoute where supported?
-can we add some sort of guardrail to prevent route explosion (maybe something like, log the number of routes and don't proceed if the computed route set is too big)
-can we add tests? (I know this is a little hypocritical given the embarrassingly sparse test coverage, but we are trying to be better about this!)

@Pawloland
Copy link
Author

Pawloland commented Feb 14, 2026

It is possible to use exclude route method for supported android versions, but since it doesn't work for all of them supported by tailscale app, and manual approach does work for all, I thought it is better to stop using it everywhere, to avoid confusion.

Regarding route explosion, I am not sure what it means. Do you mean having too many of addresses printed out in logcat, instead of just the count of them? I suppose I can remove logging them, but it was usefull when comparing with the tool I mentioned in linked issue.
If you instead meant, preventing the set of routes being applied, when the count of them in a set is too big, then I would say no. It would undermine the whole reason why they are calculated in the first place, which is to fit into the old interface of android. If only some of them were to be applied then the behavior would be different, than it is now on API 33+, and if none of them were to be applied, then it would simply do nothing.

The algorithm for calculating the CIDR ranges tries to create minimal number of them, with smallest possible masks, to cover the whole allowed address space.

About tests, I don't know how, since the code is in go aar, not in kotlin. I saw that the makefile has a target to run android code tests with Gradle but that doesn't cover go code, correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android 11 Allow LAN access toggle missing when using exit node

2 participants