types: Flesh out address comparison and string formatting
Change-Id: Ib505232e15e8db012d07759163f780b00ea4b7d3
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/network_manager_main.cpp b/src/network_manager_main.cpp
index 73df65d..5dc5b8d 100644
--- a/src/network_manager_main.cpp
+++ b/src/network_manager_main.cpp
@@ -64,14 +64,14 @@
try
{
auto inventoryMAC = mac_address::getfromInventory(bus, intfname);
- if (!mac_address::toString(inventoryMAC).empty())
+ if (inventoryMAC != ether_addr{})
{
- log<level::INFO>("Mac Address in Inventory on "),
- entry("Interface : ", intfname.c_str()),
- entry("MAC Address :",
- (mac_address::toString(inventoryMAC)).c_str());
- manager->setFistBootMACOnInterface(std::make_pair(
- intfname.c_str(), mac_address::toString(inventoryMAC)));
+ auto macStr = std::to_string(inventoryMAC);
+ log<level::INFO>("Mac Address in Inventory on ",
+ entry("Interface : ", intfname.c_str()),
+ entry("MAC Address :", macStr.c_str()));
+ manager->setFistBootMACOnInterface(
+ std::make_pair(intfname.c_str(), std::move(macStr)));
first_boot_status.push_back(intfname.c_str());
bool status = true;
for (const auto& keys : configJson.items())