netd: Enable clang-tidy and fix all warnings

Bug: 65246407
Test: m netd && system/netd/tests/runtests.sh
Change-Id: I1d22b2bc317fe7218ccde78859ed0623d6a1f8df
diff --git a/server/InterfaceController.cpp b/server/InterfaceController.cpp
index 7258ee6..34b8004 100644
--- a/server/InterfaceController.cpp
+++ b/server/InterfaceController.cpp
@@ -107,8 +107,9 @@
 }
 
 // Run @fn on each interface as well as 'default' in the path @dirname.
-void forEachInterface(const std::string& dirname,
-                      std::function<void(const std::string& path, const std::string& iface)> fn) {
+void forEachInterface(
+        const std::string& dirname,
+        const std::function<void(const std::string& path, const std::string& iface)>& fn) {
     // Run on default, which controls the behavior of any interfaces that are created in the future.
     fn(dirname, "default");
     DIR* dir = opendir(dirname.c_str());
@@ -190,7 +191,9 @@
 }  // namespace
 
 android::netdutils::Status InterfaceController::enableStablePrivacyAddresses(
-        const std::string& iface, GetPropertyFn getProperty, SetPropertyFn setProperty) {
+        const std::string& iface,
+        const GetPropertyFn& getProperty,
+        const SetPropertyFn& setProperty) {
     const auto& sys = sSyscalls.get();
     const std::string procTarget = std::string(ipv6_proc_path) + "/" + iface + "/stable_secret";
     auto procFd = sys.open(procTarget, O_CLOEXEC | O_WRONLY);