Browse Source

[dhcp] Use correct DHCP options on EFI systems

See RFC 4578 for details.

Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Geoff Lywood 14 years ago
parent
commit
6514d6430d

+ 1
- 0
src/Makefile.housekeeping View File

@@ -295,6 +295,7 @@ endif
295 295
 # Include architecture-specific include path
296 296
 ifdef ARCH
297 297
 INCDIRS		+= arch/$(ARCH)/include
298
+INCDIRS		+= arch/$(ARCH)/include/$(PLATFORM)
298 299
 endif
299 300
 
300 301
 ###############################################################################

+ 40
- 0
src/arch/i386/include/efi/ipxe/dhcp_arch.h View File

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (C) 2010 VMware, Inc.  All Rights Reserved.
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public License as
6
+ * published by the Free Software Foundation; either version 2 of the
7
+ * License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful, but
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
+ */
18
+
19
+#ifndef _DHCP_ARCH_H
20
+#define _DHCP_ARCH_H
21
+
22
+/** @file
23
+ *
24
+ * Architecture-specific DHCP options
25
+ */
26
+
27
+FILE_LICENCE ( GPL2_OR_LATER );
28
+
29
+#include <ipxe/dhcp.h>
30
+
31
+#define DHCP_ARCH_VENDOR_CLASS_ID \
32
+	DHCP_STRING ( 'P', 'X', 'E', 'C', 'l', 'i', 'e', 'n', 't', ':',      \
33
+		      'A', 'r', 'c', 'h', ':', '0', '0', '0', '0', '6', ':', \
34
+		      'U', 'N', 'D', 'I', ':', '0', '0', '3', '0', '1', '0' )
35
+
36
+#define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_WORD ( 6 )
37
+
38
+#define DHCP_ARCH_CLIENT_NDI DHCP_OPTION ( 1 /* UNDI */ , 3, 10 /* v3.10 */ )
39
+
40
+#endif

+ 40
- 0
src/arch/i386/include/pcbios/ipxe/dhcp_arch.h View File

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (C) 2010 VMware, Inc.  All Rights Reserved.
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public License as
6
+ * published by the Free Software Foundation; either version 2 of the
7
+ * License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful, but
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
+ */
18
+
19
+#ifndef _DHCP_ARCH_H
20
+#define _DHCP_ARCH_H
21
+
22
+/** @file
23
+ *
24
+ * Architecture-specific DHCP options
25
+ */
26
+
27
+FILE_LICENCE ( GPL2_OR_LATER );
28
+
29
+#include <ipxe/dhcp.h>
30
+
31
+#define DHCP_ARCH_VENDOR_CLASS_ID \
32
+	DHCP_STRING ( 'P', 'X', 'E', 'C', 'l', 'i', 'e', 'n', 't', ':',      \
33
+		      'A', 'r', 'c', 'h', ':', '0', '0', '0', '0', '0', ':', \
34
+		      'U', 'N', 'D', 'I', ':', '0', '0', '2', '0', '0', '1' )
35
+
36
+#define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_WORD ( 0 )
37
+
38
+#define DHCP_ARCH_CLIENT_NDI DHCP_OPTION ( 1 /* UNDI */ , 2, 1 /* v2.1 */ )
39
+
40
+#endif

+ 40
- 0
src/arch/x86_64/include/efi/ipxe/dhcp_arch.h View File

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright (C) 2010 VMware, Inc.  All Rights Reserved.
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public License as
6
+ * published by the Free Software Foundation; either version 2 of the
7
+ * License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful, but
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
+ */
18
+
19
+#ifndef _DHCP_ARCH_H
20
+#define _DHCP_ARCH_H
21
+
22
+/** @file
23
+ *
24
+ * Architecture-specific DHCP options
25
+ */
26
+
27
+FILE_LICENCE ( GPL2_OR_LATER );
28
+
29
+#include <ipxe/dhcp.h>
30
+
31
+#define DHCP_ARCH_VENDOR_CLASS_ID \
32
+	DHCP_STRING ( 'P', 'X', 'E', 'C', 'l', 'i', 'e', 'n', 't', ':',      \
33
+		      'A', 'r', 'c', 'h', ':', '0', '0', '0', '0', '7', ':', \
34
+		      'U', 'N', 'D', 'I', ':', '0', '0', '3', '0', '1', '0' )
35
+
36
+#define DHCP_ARCH_CLIENT_ARCHITECTURE DHCP_WORD ( 7 )
37
+
38
+#define DHCP_ARCH_CLIENT_NDI DHCP_OPTION ( 1 /* UNDI */ , 3, 10 /* v3.10 */ )
39
+
40
+#endif

+ 5
- 8
src/net/udp/dhcp.c View File

@@ -40,6 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
40 40
 #include <ipxe/dhcp.h>
41 41
 #include <ipxe/dhcpopts.h>
42 42
 #include <ipxe/dhcppkt.h>
43
+#include <ipxe/dhcp_arch.h>
43 44
 #include <ipxe/features.h>
44 45
 
45 46
 /** @file
@@ -74,14 +75,10 @@ static uint8_t dhcp_request_options_data[] = {
74 75
 	DHCP_MESSAGE_TYPE, DHCP_BYTE ( 0 ),
75 76
 	DHCP_MAX_MESSAGE_SIZE,
76 77
 	DHCP_WORD ( ETH_MAX_MTU - 20 /* IP header */ - 8 /* UDP header */ ),
77
-	DHCP_CLIENT_ARCHITECTURE, DHCP_WORD ( 0 ),
78
-	DHCP_CLIENT_NDI, DHCP_OPTION ( 1 /* UNDI */ , 2, 1 /* v2.1 */ ),
79
-	DHCP_VENDOR_CLASS_ID,
80
-	DHCP_STRING (  'P', 'X', 'E', 'C', 'l', 'i', 'e', 'n', 't', ':',
81
-		       'A', 'r', 'c', 'h', ':', '0', '0', '0', '0', '0', ':',
82
-		       'U', 'N', 'D', 'I', ':', '0', '0', '2', '0', '0', '1' ),
83
-	DHCP_USER_CLASS_ID,
84
-	DHCP_STRING ( 'g', 'P', 'X', 'E' ),
78
+	DHCP_CLIENT_ARCHITECTURE, DHCP_ARCH_CLIENT_ARCHITECTURE,
79
+	DHCP_CLIENT_NDI, DHCP_ARCH_CLIENT_NDI,
80
+	DHCP_VENDOR_CLASS_ID, DHCP_ARCH_VENDOR_CLASS_ID,
81
+	DHCP_USER_CLASS_ID, DHCP_STRING ( 'i', 'P', 'X', 'E' ),
85 82
 	DHCP_PARAMETER_REQUEST_LIST,
86 83
 	DHCP_OPTION ( DHCP_SUBNET_MASK, DHCP_ROUTERS, DHCP_DNS_SERVERS,
87 84
 		      DHCP_LOG_SERVERS, DHCP_HOST_NAME, DHCP_DOMAIN_NAME,

Loading…
Cancel
Save