mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-06 00:00:47 -04:00
android: Exclude our own app from the VPN
Otherwise, a blocking VPN interface would prevent our fetcher from working as we currently rely on an interface that doesn't allow access to the underlying socket/FD, which would be required to call VpnService.protect().
This commit is contained in:
parent
fb3772ec95
commit
99cc2d82d4
@ -955,8 +955,23 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
||||
mExcludedSubnets = IPRangeSet.fromString(profile.getExcludedSubnets());
|
||||
Integer splitTunneling = profile.getSplitTunneling();
|
||||
mSplitTunneling = splitTunneling != null ? splitTunneling : 0;
|
||||
mAppHandling = profile.getSelectedAppsHandling();
|
||||
SelectedAppsHandling appHandling = profile.getSelectedAppsHandling();
|
||||
mSelectedApps = profile.getSelectedAppsSet();
|
||||
/* exclude our own app, otherwise the fetcher is blocked */
|
||||
switch (appHandling)
|
||||
{
|
||||
case SELECTED_APPS_DISABLE:
|
||||
appHandling = SelectedAppsHandling.SELECTED_APPS_EXCLUDE;
|
||||
mSelectedApps.clear();
|
||||
/* fall-through */
|
||||
case SELECTED_APPS_EXCLUDE:
|
||||
mSelectedApps.add(getPackageName());
|
||||
break;
|
||||
case SELECTED_APPS_ONLY:
|
||||
mSelectedApps.remove(getPackageName());
|
||||
break;
|
||||
}
|
||||
mAppHandling = appHandling;
|
||||
}
|
||||
|
||||
public void addAddress(String address, int prefixLength)
|
||||
|
Loading…
x
Reference in New Issue
Block a user