Add support for fwmark split tunneling
Packets are now only marked for fwmark if their destination is in one of
the routes for the target interface.
Change-Id: Ided4ad992c4cf957d77ae11fa62ac4843a8592c7
diff --git a/UidMarkMap.cpp b/UidMarkMap.cpp
index 34764cf..d30ac53 100644
--- a/UidMarkMap.cpp
+++ b/UidMarkMap.cpp
@@ -65,3 +65,15 @@
}
return -1;
};
+
+bool UidMarkMap::anyRulesForMark(int mark) {
+ android::RWLock::AutoRLock lock(mRWLock);
+ android::netd::List<UidMarkEntry*>::iterator it;
+ for (it = mMap.begin(); it != mMap.end(); it++) {
+ UidMarkEntry *entry = *it;
+ if (entry->mark == mark) {
+ return true;
+ }
+ }
+ return false;
+}