diff --git a/src/config_parser.cpp b/src/config_parser.cpp
index e73c889..e4886ec 100644
--- a/src/config_parser.cpp
+++ b/src/config_parser.cpp
@@ -54,9 +54,8 @@
     return dir / stdplus::strCat(intf, ".netdev"sv);
 }
 
-const std::string*
-    SectionMap::getLastValueString(std::string_view section,
-                                   std::string_view key) const noexcept
+const std::string* SectionMap::getLastValueString(
+    std::string_view section, std::string_view key) const noexcept
 {
     auto sit = find(section);
     if (sit == end())
diff --git a/src/dhcp_configuration.cpp b/src/dhcp_configuration.cpp
index b818a59..da785cc 100644
--- a/src/dhcp_configuration.cpp
+++ b/src/dhcp_configuration.cpp
@@ -17,12 +17,10 @@
 using namespace phosphor::network;
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
 
-Configuration::Configuration(sdbusplus::bus_t& bus,
-                             stdplus::const_zstring objPath,
-                             stdplus::PinnedRef<EthernetInterface> parent,
-                             DHCPType type) :
-    Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-    parent(parent)
+Configuration::Configuration(
+    sdbusplus::bus_t& bus, stdplus::const_zstring objPath,
+    stdplus::PinnedRef<EthernetInterface> parent, DHCPType type) :
+    Iface(bus, objPath.c_str(), Iface::action::defer_emit), parent(parent)
 {
     config::Parser conf(config::pathForIntfConf(
         parent.get().manager.get().getConfDir(), parent.get().interfaceName()));
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index cd06003..6a34492 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -79,24 +79,20 @@
     return a.isUnicast() && !a.isLoopback();
 }
 
-EthernetInterface::EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
-                                     stdplus::PinnedRef<Manager> manager,
-                                     const AllIntfInfo& info,
-                                     std::string_view objRoot,
-                                     const config::Parser& config,
-                                     bool enabled) :
+EthernetInterface::EthernetInterface(
+    stdplus::PinnedRef<sdbusplus::bus_t> bus,
+    stdplus::PinnedRef<Manager> manager, const AllIntfInfo& info,
+    std::string_view objRoot, const config::Parser& config, bool enabled) :
     EthernetInterface(bus, manager, info, makeObjPath(objRoot, *info.intf.name),
                       config, enabled)
 {}
 
-EthernetInterface::EthernetInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
-                                     stdplus::PinnedRef<Manager> manager,
-                                     const AllIntfInfo& info,
-                                     std::string&& objPath,
-                                     const config::Parser& config,
-                                     bool enabled) :
-    Ifaces(bus, objPath.c_str(), Ifaces::action::defer_emit),
-    manager(manager), bus(bus), objPath(std::move(objPath))
+EthernetInterface::EthernetInterface(
+    stdplus::PinnedRef<sdbusplus::bus_t> bus,
+    stdplus::PinnedRef<Manager> manager, const AllIntfInfo& info,
+    std::string&& objPath, const config::Parser& config, bool enabled) :
+    Ifaces(bus, objPath.c_str(), Ifaces::action::defer_emit), manager(manager),
+    bus(bus), objPath(std::move(objPath))
 {
     interfaceName(*info.intf.name, true);
     auto dhcpVal = getDHCPValue(config);
@@ -234,10 +230,10 @@
     }
     else
     {
-        staticNeighbors.emplace(*info.addr, std::make_unique<Neighbor>(
-                                                bus, std::string_view(objPath),
-                                                *this, *info.addr, *info.mac,
-                                                Neighbor::State::Permanent));
+        staticNeighbors.emplace(
+            *info.addr, std::make_unique<Neighbor>(
+                            bus, std::string_view(objPath), *this, *info.addr,
+                            *info.mac, Neighbor::State::Permanent));
     }
 }
 
@@ -397,12 +393,12 @@
 EthernetInterface::DHCPConf EthernetInterface::dhcpEnabled(DHCPConf value)
 {
     auto old4 = EthernetInterfaceIntf::dhcp4();
-    auto new4 = EthernetInterfaceIntf::dhcp4(value == DHCPConf::v4 ||
-                                             value == DHCPConf::v4v6stateless ||
-                                             value == DHCPConf::both);
+    auto new4 = EthernetInterfaceIntf::dhcp4(
+        value == DHCPConf::v4 || value == DHCPConf::v4v6stateless ||
+        value == DHCPConf::both);
     auto old6 = EthernetInterfaceIntf::dhcp6();
-    auto new6 = EthernetInterfaceIntf::dhcp6(value == DHCPConf::v6 ||
-                                             value == DHCPConf::both);
+    auto new6 = EthernetInterfaceIntf::dhcp6(
+        value == DHCPConf::v6 || value == DHCPConf::both);
     auto oldra = EthernetInterfaceIntf::ipv6AcceptRA();
     auto newra = EthernetInterfaceIntf::ipv6AcceptRA(
         value == DHCPConf::v6stateless || value == DHCPConf::v4v6stateless ||
@@ -456,8 +452,9 @@
     {
         // We only need to bring down the interface, networkd will always bring
         // up managed interfaces
-        manager.get().addReloadPreHook(
-            [ifname = interfaceName()]() { system::setNICUp(ifname, false); });
+        manager.get().addReloadPreHook([ifname = interfaceName()]() {
+            system::setNICUp(ifname, false);
+        });
     }
     manager.get().reloadConfigs();
 
@@ -513,9 +510,9 @@
 ServerList EthernetInterface::getNTPServerFromTimeSyncd()
 {
     ServerList servers; // Variable to capture the NTP Server IPs
-    auto method = bus.get().new_method_call(TIMESYNCD_SERVICE,
-                                            TIMESYNCD_SERVICE_PATH,
-                                            PROPERTY_INTERFACE, METHOD_GET);
+    auto method =
+        bus.get().new_method_call(TIMESYNCD_SERVICE, TIMESYNCD_SERVICE_PATH,
+                                  PROPERTY_INTERFACE, METHOD_GET);
 
     method.append(TIMESYNCD_INTERFACE, "LinkNTPServers");
 
@@ -812,8 +809,8 @@
         dhcp6["SendHostname"].emplace_back(
             tfStr(dhcp6Conf->sendHostNameEnabled()));
     }
-    auto path = config::pathForIntfConf(manager.get().getConfDir(),
-                                        interfaceName());
+    auto path =
+        config::pathForIntfConf(manager.get().getConfDir(), interfaceName());
     config.writeFile(path);
     lg2::info("Wrote networkd file: {CFG_FILE}", "CFG_FILE", path);
     writeUpdatedTime(manager, path);
@@ -995,8 +992,9 @@
     if (eth.get().ifIdx > 0)
     {
         // We need to forcibly delete the interface as systemd does not
-        eth.get().manager.get().addReloadPostHook(
-            [idx = eth.get().ifIdx]() { system::deleteIntf(idx); });
+        eth.get().manager.get().addReloadPostHook([idx = eth.get().ifIdx]() {
+            system::deleteIntf(idx);
+        });
 
         // Ignore the interface so the reload doesn't re-query it
         eth.get().manager.get().ignoredIntf.emplace(eth.get().ifIdx);
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp
index 8f5aac9..195b2c0 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.cpp
@@ -59,12 +59,12 @@
 HypEthInterface::DHCPConf HypEthInterface::dhcpEnabled(DHCPConf value)
 {
     auto old4 = HypEthernetIntf::dhcp4();
-    auto new4 = HypEthernetIntf::dhcp4(value == DHCPConf::v4 ||
-                                       value == DHCPConf::v4v6stateless ||
-                                       value == DHCPConf::both);
+    auto new4 = HypEthernetIntf::dhcp4(
+        value == DHCPConf::v4 || value == DHCPConf::v4v6stateless ||
+        value == DHCPConf::both);
     auto old6 = HypEthernetIntf::dhcp6();
-    auto new6 = HypEthernetIntf::dhcp6(value == DHCPConf::v6 ||
-                                       value == DHCPConf::both);
+    auto new6 = HypEthernetIntf::dhcp6(
+        value == DHCPConf::v6 || value == DHCPConf::both);
     auto oldra = HypEthernetIntf::ipv6AcceptRA();
     auto newra = HypEthernetIntf::ipv6AcceptRA(
         value == DHCPConf::v6stateless || value == DHCPConf::v4v6stateless ||
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp
index b2f4856..5fce963 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_ethernet_interface.hpp
@@ -53,8 +53,8 @@
      */
     HypEthInterface(sdbusplus::bus_t& bus, const char* path,
                     std::string_view intfName, HypNetworkMgr& parent) :
-        CreateIface(bus, path, CreateIface::action::defer_emit),
-        bus(bus), objectPath(path), manager(parent)
+        CreateIface(bus, path, CreateIface::action::defer_emit), bus(bus),
+        objectPath(path), manager(parent)
     {
         HypEthernetIntf::interfaceName(intfName.data(), true);
         emit_object_added();
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp
index 16d3d29..2539b6b 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.cpp
@@ -104,8 +104,8 @@
         interfaces.emplace_back(biosMgrIntf);
         auto depth = 0;
 
-        auto mapperCall = bus.new_method_call(mapperBus, mapperObj, mapperIntf,
-                                              "GetSubTree");
+        auto mapperCall =
+            bus.new_method_call(mapperBus, mapperObj, mapperIntf, "GetSubTree");
 
         mapperCall.append(biosMgrObj, depth, interfaces);
 
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
index 6501e86..f01a4b9 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_network_manager.hpp
@@ -68,7 +68,7 @@
      *  @param[in] path - Path to attach at.
      */
     HypNetworkMgr(sdbusplus::bus_t& bus, const char* path) :
-        bus(bus), objectPath(path){};
+        bus(bus), objectPath(path) {};
 
     /** @brief Get the BaseBiosTable attributes
      *
diff --git a/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp b/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp
index 464ed64..5a6fd39 100644
--- a/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp
+++ b/src/ibm/hypervisor-network-mgr-src/hyp_sys_config.hpp
@@ -41,8 +41,8 @@
      */
     HypSysConfig(sdbusplus::bus_t& bus, const std::string& objPath,
                  HypNetworkMgr& parent) :
-        Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-        bus(bus), manager(parent){};
+        Iface(bus, objPath.c_str(), Iface::action::defer_emit), bus(bus),
+        manager(parent) {};
 
     /** @brief set the hostname of the system.
      *  @param[in] name - host name of the system.
diff --git a/src/inventory_mac.cpp b/src/inventory_mac.cpp
index 8e0f3cb..b5fd5f7 100644
--- a/src/inventory_mac.cpp
+++ b/src/inventory_mac.cpp
@@ -86,8 +86,8 @@
 
     auto depth = 0;
 
-    auto mapperCall = bus.new_method_call(mapperBus, mapperObj, mapperIntf,
-                                          "GetSubTree");
+    auto mapperCall =
+        bus.new_method_call(mapperBus, mapperObj, mapperIntf, "GetSubTree");
 
     mapperCall.append(invRoot, depth, interfaces);
 
@@ -177,8 +177,8 @@
             for (const auto& keys : configJson.items())
             {
                 if (!(std::find(first_boot_status.begin(),
-                                first_boot_status.end(),
-                                keys.key()) != first_boot_status.end()))
+                                first_boot_status.end(), keys.key()) !=
+                      first_boot_status.end()))
                 {
                     lg2::info("Interface {NET_INTF} MAC is NOT set from VPD",
                               "NET_INTF", keys.key());
diff --git a/src/ncsi_util.cpp b/src/ncsi_util.cpp
index 826d7de..839c80d 100644
--- a/src/ncsi_util.cpp
+++ b/src/ncsi_util.cpp
@@ -69,8 +69,7 @@
     Command(
         int ncsiCmd, int operation = DEFAULT_VALUE,
         std::span<const unsigned char> p = std::span<const unsigned char>()) :
-        ncsi_cmd(ncsiCmd),
-        operation(operation), payload(p)
+        ncsi_cmd(ncsiCmd), operation(operation), payload(p)
     {}
 
     int ncsi_cmd;
@@ -257,8 +256,8 @@
     }
 
     auto data_len = nla_len(tb[NCSI_ATTR_DATA]) - sizeof(NCSIPacketHeader);
-    unsigned char* data = (unsigned char*)nla_data(tb[NCSI_ATTR_DATA]) +
-                          sizeof(NCSIPacketHeader);
+    unsigned char* data =
+        (unsigned char*)nla_data(tb[NCSI_ATTR_DATA]) + sizeof(NCSIPacketHeader);
 
     // Dump the response to stdout. Enhancement: option to save response data
     auto str = toHexStr(std::span<const unsigned char>(data, data_len));
@@ -347,8 +346,8 @@
 
     if (cmd.operation != DEFAULT_VALUE)
     {
-        std::vector<unsigned char> pl(sizeof(NCSIPacketHeader) +
-                                      cmd.payload.size());
+        std::vector<unsigned char> pl(
+            sizeof(NCSIPacketHeader) + cmd.payload.size());
         NCSIPacketHeader* hdr = (NCSIPacketHeader*)pl.data();
 
         std::copy(cmd.payload.begin(), cmd.payload.end(),
diff --git a/src/network_manager.cpp b/src/network_manager.cpp
index 089e0e7..c412923 100644
--- a/src/network_manager.cpp
+++ b/src/network_manager.cpp
@@ -48,32 +48,33 @@
     systemdNetworkdEnabledMatch(
         bus, enabledMatch,
         [man = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
-    std::string intf;
-    std::unordered_map<std::string, std::variant<std::string>> values;
-    try
-    {
-        m.read(intf, values);
-        auto it = values.find("AdministrativeState");
-        if (it == values.end())
-        {
-            return;
-        }
-        const std::string_view obj = m.get_path();
-        auto sep = obj.rfind('/');
-        if (sep == obj.npos || sep + 3 > obj.size())
-        {
-            throw std::invalid_argument("Invalid obj path");
-        }
-        auto ifidx = stdplus::StrToInt<10, uint16_t>{}(obj.substr(sep + 3));
-        const auto& state = std::get<std::string>(it->second);
-        man.get().handleAdminState(state, ifidx);
-    }
-    catch (const std::exception& e)
-    {
-        lg2::error("AdministrativeState match parsing failed: {ERROR}", "ERROR",
-                   e);
-    }
-})
+            std::string intf;
+            std::unordered_map<std::string, std::variant<std::string>> values;
+            try
+            {
+                m.read(intf, values);
+                auto it = values.find("AdministrativeState");
+                if (it == values.end())
+                {
+                    return;
+                }
+                const std::string_view obj = m.get_path();
+                auto sep = obj.rfind('/');
+                if (sep == obj.npos || sep + 3 > obj.size())
+                {
+                    throw std::invalid_argument("Invalid obj path");
+                }
+                auto ifidx =
+                    stdplus::StrToInt<10, uint16_t>{}(obj.substr(sep + 3));
+                const auto& state = std::get<std::string>(it->second);
+                man.get().handleAdminState(state, ifidx);
+            }
+            catch (const std::exception& e)
+            {
+                lg2::error("AdministrativeState match parsing failed: {ERROR}",
+                           "ERROR", e);
+            }
+        })
 {
     reload.get().setCallback([self = stdplus::PinnedRef(*this)]() {
         for (auto& hook : self.get().reloadPreHooks)
@@ -139,8 +140,8 @@
     {
         unsigned ifidx = std::get<0>(link);
         stdplus::ToStrHandle<stdplus::IntToStr<10, unsigned>> tsh;
-        auto obj = stdplus::strCat("/org/freedesktop/network1/link/_3"sv,
-                                   tsh(ifidx));
+        auto obj =
+            stdplus::strCat("/org/freedesktop/network1/link/_3"sv, tsh(ifidx));
         auto req =
             bus.get().new_method_call("org.freedesktop.network1", obj.c_str(),
                                       "org.freedesktop.DBus.Properties", "Get");
@@ -362,34 +363,36 @@
     {
         std::visit(
             [&](auto addr) {
-            if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
-            {
-                it->second.defgw4.emplace(addr);
-            }
-            else
-            {
-                static_assert(std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                it->second.defgw6.emplace(addr);
-            }
-        },
-            addr);
-        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
-        {
-            std::visit(
-                [&](auto addr) {
                 if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
                 {
-                    it->second->EthernetInterfaceIntf::defaultGateway(
-                        stdplus::toStr(addr));
+                    it->second.defgw4.emplace(addr);
                 }
                 else
                 {
                     static_assert(
                         std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                    it->second->EthernetInterfaceIntf::defaultGateway6(
-                        stdplus::toStr(addr));
+                    it->second.defgw6.emplace(addr);
                 }
             },
+            addr);
+        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
+        {
+            std::visit(
+                [&](auto addr) {
+                    if constexpr (std::is_same_v<stdplus::In4Addr,
+                                                 decltype(addr)>)
+                    {
+                        it->second->EthernetInterfaceIntf::defaultGateway(
+                            stdplus::toStr(addr));
+                    }
+                    else
+                    {
+                        static_assert(
+                            std::is_same_v<stdplus::In6Addr, decltype(addr)>);
+                        it->second->EthernetInterfaceIntf::defaultGateway6(
+                            stdplus::toStr(addr));
+                    }
+                },
                 addr);
         }
     }
@@ -405,46 +408,52 @@
     {
         std::visit(
             [&](auto addr) {
-            if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
-            {
-                if (it->second.defgw4 == addr)
-                {
-                    it->second.defgw4.reset();
-                }
-            }
-            else
-            {
-                static_assert(std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                if (it->second.defgw6 == addr)
-                {
-                    it->second.defgw6.reset();
-                }
-            }
-        },
-            addr);
-        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
-        {
-            std::visit(
-                [&](auto addr) {
                 if constexpr (std::is_same_v<stdplus::In4Addr, decltype(addr)>)
                 {
-                    stdplus::ToStrHandle<stdplus::ToStr<stdplus::In4Addr>> tsh;
-                    if (it->second->defaultGateway() == tsh(addr))
+                    if (it->second.defgw4 == addr)
                     {
-                        it->second->EthernetInterfaceIntf::defaultGateway("");
+                        it->second.defgw4.reset();
                     }
                 }
                 else
                 {
                     static_assert(
                         std::is_same_v<stdplus::In6Addr, decltype(addr)>);
-                    stdplus::ToStrHandle<stdplus::ToStr<stdplus::In6Addr>> tsh;
-                    if (it->second->defaultGateway6() == tsh(addr))
+                    if (it->second.defgw6 == addr)
                     {
-                        it->second->EthernetInterfaceIntf::defaultGateway6("");
+                        it->second.defgw6.reset();
                     }
                 }
             },
+            addr);
+        if (auto it = interfacesByIdx.find(ifidx); it != interfacesByIdx.end())
+        {
+            std::visit(
+                [&](auto addr) {
+                    if constexpr (std::is_same_v<stdplus::In4Addr,
+                                                 decltype(addr)>)
+                    {
+                        stdplus::ToStrHandle<stdplus::ToStr<stdplus::In4Addr>>
+                            tsh;
+                        if (it->second->defaultGateway() == tsh(addr))
+                        {
+                            it->second->EthernetInterfaceIntf::defaultGateway(
+                                "");
+                        }
+                    }
+                    else
+                    {
+                        static_assert(
+                            std::is_same_v<stdplus::In6Addr, decltype(addr)>);
+                        stdplus::ToStrHandle<stdplus::ToStr<stdplus::In6Addr>>
+                            tsh;
+                        if (it->second->defaultGateway6() == tsh(addr))
+                        {
+                            it->second->EthernetInterfaceIntf::defaultGateway6(
+                                "");
+                        }
+                    }
+                },
                 addr);
         }
     }
diff --git a/src/rtnetlink_server.cpp b/src/rtnetlink_server.cpp
index 1e3ac71..4a211d5 100644
--- a/src/rtnetlink_server.cpp
+++ b/src/rtnetlink_server.cpp
@@ -123,8 +123,8 @@
 Server::Server(sdeventplus::Event& event, Manager& manager) :
     sock(makeSock()),
     io(event, sock.get(), EPOLLIN | EPOLLET, [&](auto&&... args) {
-    return eventHandler(manager, std::forward<decltype(args)>(args)...);
-})
+        return eventHandler(manager, std::forward<decltype(args)>(args)...);
+    })
 {
     auto cb = [&](const nlmsghdr& hdr, std::string_view data) {
         handler(manager, hdr, data);
diff --git a/src/system_configuration.cpp b/src/system_configuration.cpp
index b008dba..ee6cdb7 100644
--- a/src/system_configuration.cpp
+++ b/src/system_configuration.cpp
@@ -26,34 +26,35 @@
 
 SystemConfiguration::SystemConfiguration(
     stdplus::PinnedRef<sdbusplus::bus_t> bus, stdplus::const_zstring objPath) :
-    Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-    bus(bus), hostnamePropMatch(
-                  bus, propMatch,
-                  [sc = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
-    std::string intf;
-    std::unordered_map<std::string, std::variant<std::string>> values;
-    try
-    {
-        m.read(intf, values);
-        auto it = values.find("Hostname");
-        if (it == values.end())
-        {
-            return;
-        }
-        sc.get().Iface::hostName(std::get<std::string>(it->second));
-    }
-    catch (const std::exception& e)
-    {
-        lg2::error("Hostname match parsing failed: {ERROR}", "ERROR", e);
-    }
-})
+    Iface(bus, objPath.c_str(), Iface::action::defer_emit), bus(bus),
+    hostnamePropMatch(
+        bus, propMatch,
+        [sc = stdplus::PinnedRef(*this)](sdbusplus::message_t& m) {
+            std::string intf;
+            std::unordered_map<std::string, std::variant<std::string>> values;
+            try
+            {
+                m.read(intf, values);
+                auto it = values.find("Hostname");
+                if (it == values.end())
+                {
+                    return;
+                }
+                sc.get().Iface::hostName(std::get<std::string>(it->second));
+            }
+            catch (const std::exception& e)
+            {
+                lg2::error("Hostname match parsing failed: {ERROR}", "ERROR",
+                           e);
+            }
+        })
 {
     try
     {
         std::variant<std::string> name;
-        auto req = bus.get().new_method_call(HOSTNAMED_SVC, HOSTNAMED_OBJ,
-                                             "org.freedesktop.DBus.Properties",
-                                             "Get");
+        auto req =
+            bus.get().new_method_call(HOSTNAMED_SVC, HOSTNAMED_OBJ,
+                                      "org.freedesktop.DBus.Properties", "Get");
 
         req.append(HOSTNAMED_INTF, "Hostname");
         auto reply = req.call();
diff --git a/src/system_queries.cpp b/src/system_queries.cpp
index 87ba4aa..712fc08 100644
--- a/src/system_queries.cpp
+++ b/src/system_queries.cpp
@@ -27,8 +27,8 @@
 static stdplus::Fd& getIFSock()
 {
     using namespace stdplus::fd;
-    static auto fd = socket(SocketDomain::INet, SocketType::Datagram,
-                            SocketProto::IP);
+    static auto fd =
+        socket(SocketDomain::INet, SocketType::Datagram, SocketProto::IP);
     return fd;
 }
 
@@ -88,8 +88,9 @@
     return optionalIFReq(
                ifname, SIOCETHTOOL, "ETHTOOL"sv,
                [&](const ifreq&) {
-        return EthInfo{.autoneg = edata.autoneg != 0, .speed = edata.speed};
-    },
+                   return EthInfo{.autoneg = edata.autoneg != 0,
+                                  .speed = edata.speed};
+               },
                &edata)
         .value_or(EthInfo{});
 }
@@ -120,16 +121,17 @@
     ifinfomsg msg = {};
     msg.ifi_family = AF_UNSPEC;
     msg.ifi_index = idx;
-    netlink::performRequest(NETLINK_ROUTE, RTM_DELLINK, NLM_F_REPLACE, msg,
-                            [&](const nlmsghdr& hdr, std::string_view data) {
-        int err = 0;
-        if (hdr.nlmsg_type == NLMSG_ERROR)
-        {
-            err = netlink::extractRtData<nlmsgerr>(data).error;
-        }
-        throw std::runtime_error(
-            std::format("Failed to delete `{}`: {}", idx, strerror(err)));
-    });
+    netlink::performRequest(
+        NETLINK_ROUTE, RTM_DELLINK, NLM_F_REPLACE, msg,
+        [&](const nlmsghdr& hdr, std::string_view data) {
+            int err = 0;
+            if (hdr.nlmsg_type == NLMSG_ERROR)
+            {
+                err = netlink::extractRtData<nlmsgerr>(data).error;
+            }
+            throw std::runtime_error(
+                std::format("Failed to delete `{}`: {}", idx, strerror(err)));
+        });
 }
 
 } // namespace phosphor::network::system
