+ Only remove netId/permission after doing everything that references them.
+ Return success/failure correctly based on return value of fork/exec.
Conflicts:
NetworkController.cpp
Change-Id: Iddb8ccdffc104ffed1058ecc2421006beebd568d
status = false;
}
}
- mPermissionsController->setPermissionForNetwork(PERMISSION_NONE, netId);
- mNetIdToInterfaces.erase(netId);
if (netId == getDefaultNetwork()) {
// Could the default network have changed from below us, after we evaluated the 'if', making
setDefaultNetwork(NETID_UNSET);
}
+ mPermissionsController->setPermissionForNetwork(PERMISSION_NONE, netId);
+ mNetIdToInterfaces.erase(netId);
+
// TODO: Uncomment once this API has been added to bionic.
#if 0
_resolv_delete_cache_for_net(netId);
}
}
- return android_fork_execvp(argc, const_cast<char**>(argv), NULL, false, false);
+ return !android_fork_execvp(argc, const_cast<char**>(argv), NULL, false, false);
}
bool modifyPerNetworkRules(unsigned netId, const char* interface, Permission permission, bool add,