summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2022-11-03 01:58:48 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-11-03 01:58:48 +0000
commit4283c7458e5bfd5e4731f9e348d844adfe1e29a4 (patch)
treeb942f04efdccc25a5c5c73226996bc42d6379826
parent621d0b5fcf1cfaf1ce71e63e3d8cffae664a9836 (diff)
parent903d42b520d716dbd0a6d89b98b909ba8ec3bb01 (diff)
downloadwifi-4283c7458e5bfd5e4731f9e348d844adfe1e29a4.tar.gz
Merge "Make epaddr_buf a union." am: 903d42b520
Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/net/wifi/+/2241763 Change-Id: I81af59d04641405d76b92bff5097068f2dd47670 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-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;