diff mbox series

[04/11] Expand hwaddr buffers

Message ID 3a568a0093fbd5831780bec3bddf370cfc416e10.1587059235.git.weeksd2@rpi.edu
State New
Headers show
Series IB netboot 2/3: longer hwaddr/guid support | expand

Commit Message

Daniel M. Weeks April 16, 2020, 5:59 p.m. UTC
This expands the hwaddr buffers to 8 bytes - large enough to store an
Infiniband GUID.

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

Patch

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,