Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow apps to bypass the VPN #24

Merged
merged 1 commit into from
Aug 2, 2018
Merged

Allow apps to bypass the VPN #24

merged 1 commit into from
Aug 2, 2018

Conversation

bemasc
Copy link
Contributor

@bemasc bemasc commented Jul 27, 2018

In practice, apps could easily bypass Intra anyway, e.g. by
sending queries to a hardcoded resolver. Explicitly allowing
bypass fixes #18 (interference with some WebRTC-based apps).

@bemasc bemasc changed the base branch from bemasc-format to bemasc-bypass July 27, 2018 19:39
@cjhenck
Copy link
Contributor

cjhenck commented Aug 1, 2018

LGTM

@cjhenck cjhenck self-requested a review August 1, 2018 17:09
In practice, apps could easily bypass Intra anyway, e.g. by
sending queries to a hardcoded resolver.  Explicitly allowing
bypass fixes #18 (interference with some WebRTC-based apps).
@bemasc bemasc merged commit 79cb52d into bemasc-bypass Aug 2, 2018
builder = builder.setBlocking(true);
// Some WebRTC apps rely on the ability to bind to specific interfaces, which is only
// possible if we allow bypass.
builder = builder.allowBypass();
Copy link
Contributor

@ignoramous ignoramous Mar 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't allowBypass required only for apps that don't offer full routing (unlike Intra which does route all of the IPv4 space)?

I read the source and I see either RULE_PRIORITY_SECURE_VPN or RULE_PRIORITY_BYPASSABLE_VPN fwmarks set on netId and sockets depending on if the VPN is secure (which it is when allowBypass is not set or the VPN is in "lockdown mode" aka the "Block connections without VPN" mode settable by the user through Android's VPN settings), which (I am not sure) are used to make routing decisions later?

Regardless, it remains unclear to me whether webrtc ICE sessions benefit from allowBypass? Is there a way to validate this?

An unintended effect of setting allowBypass is the VPN is without Internet connectivity if the user also chooses to start it in "lockdown mode": Ref; and so, allowBypass must be unset when the VPN is locked-down, like so celzero/rethink-app@71e1a840b, to unblock connectivity to the Internet.

Copy link
Contributor

@ignoramous ignoramous Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't allowBypass required only for apps that don't offer full routing (unlike Intra which does route all of the IPv4 space)?

In addition to this, it might be worth taking a look at IntraVpnService#setUnderlyingNetworks which only adds one network, the current active-network, but could also add all other networks the OS is connected to (with active-network in the first position in the array).

Also: allowBypass, from the documentation, lets an app bind its sockets to any network, but if all networks are also bound to VPN, then they might not need to bypass the VPN in the first place?

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.

3 participants