Revert "Revert "Allow unknown addresses""

This reverts commit 9b224314eb.
This commit is contained in:
M66B 2016-02-12 21:19:43 +01:00
parent c456948827
commit 6b6b2769d8
1 changed files with 8 additions and 3 deletions

View File

@ -513,7 +513,7 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
showAccessNotification(packet.uid);
}
if (packet.uid < 0 && packet.dport != 53)
if (packet.uid < 0)
Log.w(TAG, "Unknown application packet " + packet);
}
@ -1197,8 +1197,13 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
packet.allowed = false;
if (prefs.getBoolean("filter", false)) {
if (packet.uid < 0) // unknown
packet.allowed = true;
// https://android.googlesource.com/platform/system/core/+/master/include/private/android_filesystem_config.h
if (packet.uid < 2000 &&
!(packet.uid == 0 || // root
packet.uid == 1000 || // system server
packet.uid == 1001 || // telephony subsystem
packet.uid == 1013)) // mediaserver
packet.allowed = true; // allow unknown traffic
else {
boolean filtered = false;
// Only TCP (6) and UDP (17) have port numbers