summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libwifi_system_iface/interface_tool.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libwifi_system_iface/interface_tool.cpp b/libwifi_system_iface/interface_tool.cpp
index f7158cd64..2dc23a3d0 100644
--- a/libwifi_system_iface/interface_tool.cpp
+++ b/libwifi_system_iface/interface_tool.cpp
@@ -144,10 +144,10 @@ bool InterfaceTool::SetMacAddress(const char* if_name,
std::array<uint8_t, ETH_ALEN> InterfaceTool::GetFactoryMacAddress(const char* if_name) {
std::array<uint8_t, ETH_ALEN> paddr = {};
struct ifreq ifr;
- struct {
- // Allocate ETH_ALEN bytes after ethtool_perm_addr.
+ union {
struct ethtool_perm_addr epaddr;
- uint8_t data[ETH_ALEN];
+ // Add ETH_ALEN bytes to size of structure.
+ uint8_t raw[sizeof(ethtool_perm_addr) + ETH_ALEN];
} epaddr_buf;
struct ethtool_perm_addr* epaddr = &epaddr_buf.epaddr;