[PATCH 04/11] Expand hwaddr buffers

Daniel M. Weeks weeksd2 at rpi.edu
Fri Apr 17 03:59:08 AEST 2020


This expands the hwaddr buffers to 8 bytes - large enough to store an
Infiniband GUID.

Signed-off-by: Daniel M. Weeks <weeksd2 at rpi.edu>
---
 discover/network.c | 4 ++--
 lib/types/types.h  | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/discover/network.c b/discover/network.c
index 68400a5..6887fc5 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -25,7 +25,7 @@
 #include "device-handler.h"
 #include "paths.h"
 
-#define MAC_HWADDR_SIZE	6
+#define MAX_HWADDR_SIZE	8
 #define PIDFILE_BASE	(LOCAL_STATE_DIR "/petitboot/")
 #define INITIAL_BUFSIZE	4096
 
@@ -42,7 +42,7 @@
 struct interface {
 	int		ifindex;
 	char		name[IFNAMSIZ];
-	uint8_t		hwaddr[MAC_HWADDR_SIZE];
+	uint8_t		hwaddr[MAX_HWADDR_SIZE];
 	unsigned int	hwaddr_len;
 
 	enum {
diff --git a/lib/types/types.h b/lib/types/types.h
index 674a748..ab46a69 100644
--- a/lib/types/types.h
+++ b/lib/types/types.h
@@ -138,9 +138,11 @@ struct system_info {
 
 #define MAC_HWADDR_SIZE	6
 
+#define MAX_HWADDR_SIZE	8
+
 struct interface_config {
 	unsigned int	hwaddr_len;
-	uint8_t		hwaddr[MAC_HWADDR_SIZE];
+	uint8_t		hwaddr[MAX_HWADDR_SIZE];
 	bool		ignore;
 	enum {
 		CONFIG_METHOD_DHCP,
-- 
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