elilo/elilo-fix-amd64-netboot.diff

45 lines
1.4 KiB
Diff

diff -ur elilo.a/glue_netfs.c elilo.b/glue_netfs.c
--- elilo.a/glue_netfs.c 2009-02-05 15:22:00.000000000 +0100
+++ elilo.b/glue_netfs.c 2009-02-05 20:53:11.000000000 +0100
@@ -143,6 +143,7 @@
UINTN m;
CHAR16 ip_var[64], str[64];
UINT8 *ip;
+ INTN len;
if (config == NULL || kname == NULL || maxlen < 1) return EFI_INVALID_PARAMETER;
@@ -191,6 +192,8 @@
# endif
# define CONFIG_EXTENSION L".conf\0"
+
+ len = StrLen(CONFIG_ARCH_EXTENSION) + 1;
/*
* will try machine/subnet specific files first.
* the filenames are constructed based on the IP(v4) address
@@ -200,19 +203,19 @@
StrnCpy(config[0].fname+8, CONFIG_EXTENSION, 6);
StrnCpy(config[1].fname, str, maxlen-1);
- StrnCpy(config[1].fname+6, CONFIG_ARCH_EXTENSION, 11);
+ StrnCpy(config[1].fname+6, CONFIG_ARCH_EXTENSION, len);
StrnCpy(config[2].fname, str, maxlen-1);
StrnCpy(config[2].fname+6, CONFIG_EXTENSION, 6);
StrnCpy(config[3].fname, str, maxlen-1);
- StrnCpy(config[3].fname+4, CONFIG_ARCH_EXTENSION, 11);
+ StrnCpy(config[3].fname+4, CONFIG_ARCH_EXTENSION, len);
StrnCpy(config[4].fname, str, maxlen-1);
StrnCpy(config[4].fname+4, CONFIG_EXTENSION, 6);
-
+
StrnCpy(config[5].fname, str, maxlen-1);
- StrnCpy(config[5].fname+2, CONFIG_ARCH_EXTENSION, 11);
+ StrnCpy(config[5].fname+2, CONFIG_ARCH_EXTENSION, len);
StrnCpy(config[6].fname, str, maxlen-1);
StrnCpy(config[6].fname+2, CONFIG_EXTENSION, 6);