diff mbox series

[05/11] Parse GUIDs from NVRAM

Message ID 0d7f3d5b9104ca40d065c49f370846480525f040.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
Parse any length hardware address from NVRAM, up to the maximum size of
the buffer.

Signed-off-by: Daniel M. Weeks <weeksd2@rpi.edu>
---
 discover/platform-powerpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index 29f8003..a6e24fc 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -263,7 +263,7 @@  static int parse_hwaddr(struct interface_config *ifconf, char *str)
 {
 	unsigned int i;
 
-	if (strlen(str) != strlen("00:00:00:00:00:00"))
+	if (strlen(str) > 3*MAX_HWADDR_SIZE-1)
 		return -1;
 
 	ifconf->hwaddr_len = strlen(str) / 3 + 1;