summaryrefslogtreecommitdiff
path: root/server/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/main.cpp')
-rw-r--r--server/main.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/main.cpp b/server/main.cpp
index 35c53de7..3c6b0d52 100644
--- a/server/main.cpp
+++ b/server/main.cpp
@@ -96,7 +96,15 @@ int tagSocketCallback(int sockFd, uint32_t tag, uid_t uid, pid_t) {
return libnetd_updatable_tagSocket(sockFd, tag, uid, AID_DNS);
}
-bool evaluateDomainNameCallback(const android_net_context&, const char* /*name*/) {
+bool evaluateDomainNameCallback(const android_net_context& netcontext, const char* /*name*/) {
+ // OEMs should NOT modify IF statement, or DNS control provided by mainline modules may break.
+ if (!gCtls->netCtrl.isUidAllowed(netcontext.app_netid, netcontext.uid)) {
+ ALOGI("uid %d is not allowed to use netid %u", netcontext.uid, netcontext.app_netid);
+ return false;
+ }
+
+ // Add OEM customization from here
+ // ...
return true;
}