OSDN Git Service

Merge "Allow overlap in UidMarkMap" into klp-dev
[android-x86/system-netd.git] / UidMarkMap.cpp
index 5fc9ce0..13630d3 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "UidMarkMap.h"
+#include "NetdConstants.h"
 
 UidMarkMap::UidMarkEntry::UidMarkEntry(int start, int end, int new_mark) :
                                             uid_start(start),
@@ -56,7 +57,9 @@ int UidMarkMap::getMark(int uid) {
             return entry->mark;
         }
     }
-    return -1;
+    // If the uid has no mark specified then it should be protected from any VPN rules that might
+    // be affecting the service acting on its behalf.
+    return PROTECT_MARK;
 };
 
 bool UidMarkMap::anyRulesForMark(int mark) {