Allow unfiltered UDP traffic

This commit is contained in:
M66B 2019-05-22 15:15:08 +02:00
parent b0c762d133
commit 086bc5e201
1 changed files with 6 additions and 3 deletions

View File

@ -1843,10 +1843,13 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
lock.readLock().lock(); lock.readLock().lock();
packet.allowed = false; packet.allowed = false;
if (prefs.getBoolean("filter", false) && if (prefs.getBoolean("filter", false)) {
(packet.protocol != 17 || prefs.getBoolean("filter_udp", false))) {
// https://android.googlesource.com/platform/system/core/+/master/include/private/android_filesystem_config.h // https://android.googlesource.com/platform/system/core/+/master/include/private/android_filesystem_config.h
if (packet.uid < 2000 && if (packet.protocol == 17 /* UDP */ && !prefs.getBoolean("filter_udp", false)) {
// Allow unfiltered UDP
packet.allowed = true;
Log.i(TAG, "Allowing UDP " + packet);
} else if (packet.uid < 2000 &&
!last_connected && isSupported(packet.protocol)) { !last_connected && isSupported(packet.protocol)) {
// Allow system applications in disconnected state // Allow system applications in disconnected state
packet.allowed = true; packet.allowed = true;