ClatdController - add mutex annotations
This effectively makes ClatdController single threaded.
Which makes things nice and simple.
Test: atest libbpf_android_test libnetdbpf_test netd_integration_test netd_unit_test netdutils_test resolv_integration_test resolv_unit_test
Bug: 65674744
Change-Id: I352761b6c44c17f9ea0897ea821a826f642659d5
diff --git a/server/NetdNativeService.cpp b/server/NetdNativeService.cpp
index b1b5e0b..c2598ce 100644
--- a/server/NetdNativeService.cpp
+++ b/server/NetdNativeService.cpp
@@ -852,13 +852,13 @@
binder::Status NetdNativeService::clatdStart(const std::string& ifName,
const std::string& nat64Prefix, std::string* v6Addr) {
- NETD_LOCKING_RPC(gCtls->clatdCtrl.mutex, PERM_NETWORK_STACK, PERM_MAINLINE_NETWORK_STACK);
+ ENFORCE_ANY_PERMISSION(PERM_NETWORK_STACK, PERM_MAINLINE_NETWORK_STACK);
int res = gCtls->clatdCtrl.startClatd(ifName.c_str(), nat64Prefix, v6Addr);
return statusFromErrcode(res);
}
binder::Status NetdNativeService::clatdStop(const std::string& ifName) {
- NETD_LOCKING_RPC(gCtls->clatdCtrl.mutex, PERM_NETWORK_STACK, PERM_MAINLINE_NETWORK_STACK);
+ ENFORCE_ANY_PERMISSION(PERM_NETWORK_STACK, PERM_MAINLINE_NETWORK_STACK);
int res = gCtls->clatdCtrl.stopClatd(ifName.c_str());
return statusFromErrcode(res);
}