ethernet_interface: Emit error when missing MAC
Now that our MAC address is being mocked in our test suite we can
actually error out when the HWADDR info is missing.
Change-Id: I84ac492774ba026194dc90c53f64aa63d9a3b1ca
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index 4acbdc5..82be20e 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -268,7 +268,7 @@
{
log<level::ERR>("socket creation failed:",
entry("ERROR=%s", strerror(errno)));
- return "";
+ elog<InternalFailure>();
}
std::strcpy(ifr.ifr_name, interfaceName.c_str());
@@ -276,7 +276,7 @@
{
log<level::ERR>("ioctl failed for SIOCGIFHWADDR:",
entry("ERROR=%s", strerror(errno)));
- return "";
+ elog<InternalFailure>();
}
static_assert(sizeof(ifr.ifr_hwaddr.sa_data) >= sizeof(ether_addr));