summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-05-12 15:51:45 +0200
committerTom Rini <trini@konsulko.com>2016-05-27 15:39:49 -0400
commitbc6fc28b8604eddb527217b450d86d368cc25d13 (patch)
tree79d6662a6cb353b7add5d6827e8487c1f17d8a9c /net
parent6a6187efd238373a351369d23966e7e1759b5ad9 (diff)
net: Optionally use pxe client arch from variable
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>
Diffstat (limited to 'net')
-rw-r--r--net/bootp.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 85dc524df4..aa6cdf0a47 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -440,10 +440,10 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
{
u8 *start = e;
u8 *cnt;
-#if defined(CONFIG_BOOTP_PXE)
+#ifdef CONFIG_LIB_UUID
char *uuid;
- u16 clientarch;
#endif
+ int clientarch = -1;
#if defined(CONFIG_BOOTP_VENDOREX)
u8 *x;
@@ -499,12 +499,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;
@@ -512,6 +519,7 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
*e++ = 0; /* major revision */
*e++ = 0; /* minor revision */
+#ifdef CONFIG_LIB_UUID
uuid = getenv("pxeuuid");
if (uuid) {