[PATCH 03/11] Use hwsize rather than HWADDR_SIZE

Daniel M. Weeks weeksd2 at rpi.edu
Fri Apr 17 03:54:18 AEST 2020


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 at rpi.edu>
---
 discover/network.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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);
-- 
Daniel M. Weeks


-- 
Daniel M. Weeks
Lead HPC Developer
Center for Computational Innovations
Rensselaer Polytechnic Institute
Troy, NY 12180
518-276-4458


More information about the Petitboot mailing list