Rework the determination of a "valid network".
+ isNetIdValid() doesn't make much sense. What we want is whether the netId has
actually been created (via createNetwork()).
+ It isn't an error to call deleteNetwork() or setDefaultNetwork() even when
there are no interfaces assigned to the network.
+ Secure all accesses to the maps in PermissionsController with locks; they are
called from many threads (CommandListener, DnsProxyListener and FwmarkServer).
+ Remove the redundant mIfaceNetidMap.
+ Minor cosmetic changes to things such as #includes and log messages.
Change-Id: Ieb154589b24f00ba8067eaaec4def3534aec4923
diff --git a/server/RouteController.cpp b/server/RouteController.cpp
index a58f02d..7f9ce39 100644
--- a/server/RouteController.cpp
+++ b/server/RouteController.cpp
@@ -278,11 +278,11 @@
modifyPerNetworkRules(netId, interface, oldPermission, false, false);
}
-bool RouteController::addDefaultNetwork(const char* interface, Permission permission) {
+bool RouteController::addToDefaultNetwork(const char* interface, Permission permission) {
return modifyDefaultNetworkRules(interface, permission, ADD);
}
-bool RouteController::removeDefaultNetwork(const char* interface, Permission permission) {
+bool RouteController::removeFromDefaultNetwork(const char* interface, Permission permission) {
return modifyDefaultNetworkRules(interface, permission, DEL);
}