@@ -431,10 +431,8 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
{
u8 *start = e;
u8 *cnt;
-#if defined(CONFIG_BOOTP_PXE)
char *uuid;
- u16 clientarch;
-#endif
+ int clientarch = -1;
#if defined(CONFIG_BOOTP_VENDOREX)
u8 *x;
@@ -490,12 +488,19 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
}
#endif
-#if defined(CONFIG_BOOTP_PXE)
+#ifdef CONFIG_BOOTP_PXE_CLIENTARCH
clientarch = CONFIG_BOOTP_PXE_CLIENTARCH;
- *e++ = 93; /* Client System Architecture */
- *e++ = 2;
- *e++ = (clientarch >> 8) & 0xff;
- *e++ = clientarch & 0xff;
+#endif
+
+ if (getenv("bootp_arch"))
+ clientarch = getenv_ulong("bootp_arch", 16, clientarch);
+
+ if (clientarch > 0) {
+ *e++ = 93; /* Client System Architecture */
+ *e++ = 2;
+ *e++ = (clientarch >> 8) & 0xff;
+ *e++ = clientarch & 0xff;
+ }
*e++ = 94; /* Client Network Interface Identifier */
*e++ = 3;
@@ -517,7 +522,6 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
printf("Invalid pxeuuid: %s\n", uuid);
}
}
-#endif
e = add_vci(e);
The client architecture that we pass to a dhcp server depends on the target payload that we want to execute. An EFI binary has a different client arch than a legacy binary or a u-boot binary. So let's parameterize the pxe client arch field to allow an override via the distro script, so that our efi boot path can tell the dhcp server that it's actually an efi firmware. Signed-off-by: Alexander Graf <agraf@suse.de> --- net/bootp.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)