diff mbox series

[03/11] Use hwsize rather than HWADDR_SIZE

Message ID 55f2711b818b0d5aa535b74ec514058c0738dba0.1587059210.git.weeksd2@rpi.edu
State New
Headers show
Series IB netboot 1/3: flexible hwaddrs | expand

Commit Message

Daniel M. Weeks April 16, 2020, 5:54 p.m. UTC
This is mainly housekeeping in the interest of future flexibility. For
now, hwsize is still required to be HWADDR_SIZE.

Signed-off-by: Daniel M. Weeks <weeksd2@rpi.edu>
---
 discover/network.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/discover/network.c b/discover/network.c
index 041367f..62df720 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -684,7 +684,7 @@  void network_mark_interface_ready(struct device_handler *handler,
 		interface = talloc_zero(network, struct interface);
 		interface->ifindex = ifindex;
 		interface->state = IFSTATE_NEW;
-		memcpy(interface->hwaddr, mac, HWADDR_SIZE);
+		memcpy(interface->hwaddr, mac, hwsize);
 		strncpy(interface->name, ifname, sizeof(interface->name) - 1);
 
 		list_for_each_entry(&network->interfaces, tmp, list)
@@ -713,7 +713,7 @@  void network_mark_interface_ready(struct device_handler *handler,
 			talloc_strdup(interface->dev->device, ifname);
 	}
 
-	if (memcmp(interface->hwaddr, mac, HWADDR_SIZE) != 0) {
+	if (memcmp(interface->hwaddr, mac, hwsize) != 0) {
 		macstr = mac_bytes_to_string(interface, mac, hwsize);
 		pb_log("Warning - new MAC for interface %d does not match: %s\n",
 				ifindex, macstr);