Browse Source

Add pxe_set_cached_filename() so that pxe_tftp.c can also update the

stored DHCP packets.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
c9c8cdeb8b
2 changed files with 22 additions and 12 deletions
  1. 2
    0
      src/include/pxe.h
  2. 20
    12
      src/interface/pxe/pxe_preboot.c

+ 2
- 0
src/include/pxe.h View File

@@ -144,4 +144,6 @@ extern struct net_device *pxe_netdev;
144 144
 
145 145
 extern void pxe_set_netdev ( struct net_device *netdev );
146 146
 
147
+extern void pxe_set_cached_filename ( const unsigned char *filename );
148
+
147 149
 #endif /* PXE_H */

+ 20
- 12
src/interface/pxe/pxe_preboot.c View File

@@ -68,6 +68,24 @@ union pxe_cached_info {
68 68
 static union pxe_cached_info __bss16_array ( cached_info, [NUM_CACHED_INFOS] );
69 69
 #define cached_info __use_data16 ( cached_info )
70 70
 
71
+/**
72
+ * Set PXE cached TFTP filename
73
+ *
74
+ * @v filename		TFTP filename
75
+ *
76
+ * This is a bug-for-bug compatibility hack needed in order to work
77
+ * with Microsoft Remote Installation Services (RIS).  The filename
78
+ * used in a call to PXENV_RESTART_TFTP or PXENV_TFTP_READ_FILE must
79
+ * be returned as the DHCP filename in subsequent calls to
80
+ * PXENV_GET_CACHED_INFO.
81
+ */
82
+void pxe_set_cached_filename ( const unsigned char *filename ) {
83
+	memcpy ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file, filename,
84
+		 sizeof ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file ) );
85
+	memcpy ( cached_info[CACHED_INFO_BINL].dhcphdr.file, filename,
86
+		 sizeof ( cached_info[CACHED_INFO_BINL].dhcphdr.file ) );
87
+}
88
+
71 89
 /**
72 90
  * UNLOAD BASE CODE STACK
73 91
  *
@@ -196,18 +214,8 @@ PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE
196 214
 
197 215
 	DBG ( "PXENV_RESTART_TFTP " );
198 216
 
199
-	/* This is a bug-for-bug compatibility hack needed in order to
200
-	 * work with Microsoft Remote Installation Services (RIS).
201
-	 * The filename used in a call to PXENV_RESTART_TFTP must be
202
-	 * returned as the DHCP filename in subsequent calls to
203
-	 * PXENV_GET_CACHED_INFO.
204
-	 */
205
-	memcpy ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file,
206
-		 restart_tftp->FileName,
207
-		 sizeof ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file ) );
208
-	memcpy ( cached_info[CACHED_INFO_BINL].dhcphdr.file,
209
-		 restart_tftp->FileName,
210
-		 sizeof ( cached_info[CACHED_INFO_BINL].dhcphdr.file ) );
217
+	/* Intel bug-for-bug hack */
218
+	pxe_set_cached_filename ( restart_tftp->FileName );
211 219
 
212 220
 	/* Words cannot describe the complete mismatch between the PXE
213 221
 	 * specification and any possible version of reality...

Loading…
Cancel
Save