aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2008-01-22 18:51:12 +0000
committerMichael Brown <mcb30@etherboot.org>2008-01-22 18:51:12 +0000
commitc9c8cdeb8b3c914b68b48b611640e70ec9f47c80 (patch)
tree80ad7e2e95248a116ce45743d514efcf174965bb
parent84f99f781e405f90460f72cd3f5c1b5f97242f06 (diff)
downloadipxe-c9c8cdeb8b3c914b68b48b611640e70ec9f47c80.tar.gz
Add pxe_set_cached_filename() so that pxe_tftp.c can also update the
stored DHCP packets.
-rw-r--r--src/include/pxe.h2
-rw-r--r--src/interface/pxe/pxe_preboot.c32
2 files changed, 22 insertions, 12 deletions
diff --git a/src/include/pxe.h b/src/include/pxe.h
index ecb664d5..f17d8f77 100644
--- a/src/include/pxe.h
+++ b/src/include/pxe.h
@@ -144,4 +144,6 @@ extern struct net_device *pxe_netdev;
extern void pxe_set_netdev ( struct net_device *netdev );
+extern void pxe_set_cached_filename ( const unsigned char *filename );
+
#endif /* PXE_H */
diff --git a/src/interface/pxe/pxe_preboot.c b/src/interface/pxe/pxe_preboot.c
index 63451497..53ece3cb 100644
--- a/src/interface/pxe/pxe_preboot.c
+++ b/src/interface/pxe/pxe_preboot.c
@@ -69,6 +69,24 @@ static union pxe_cached_info __bss16_array ( cached_info, [NUM_CACHED_INFOS] );
#define cached_info __use_data16 ( cached_info )
/**
+ * Set PXE cached TFTP filename
+ *
+ * @v filename TFTP filename
+ *
+ * This is a bug-for-bug compatibility hack needed in order to work
+ * with Microsoft Remote Installation Services (RIS). The filename
+ * used in a call to PXENV_RESTART_TFTP or PXENV_TFTP_READ_FILE must
+ * be returned as the DHCP filename in subsequent calls to
+ * PXENV_GET_CACHED_INFO.
+ */
+void pxe_set_cached_filename ( const unsigned char *filename ) {
+ memcpy ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file, filename,
+ sizeof ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file ) );
+ memcpy ( cached_info[CACHED_INFO_BINL].dhcphdr.file, filename,
+ sizeof ( cached_info[CACHED_INFO_BINL].dhcphdr.file ) );
+}
+
+/**
* UNLOAD BASE CODE STACK
*
* @v None -
@@ -196,18 +214,8 @@ PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE
DBG ( "PXENV_RESTART_TFTP " );
- /* This is a bug-for-bug compatibility hack needed in order to
- * work with Microsoft Remote Installation Services (RIS).
- * The filename used in a call to PXENV_RESTART_TFTP must be
- * returned as the DHCP filename in subsequent calls to
- * PXENV_GET_CACHED_INFO.
- */
- memcpy ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file,
- restart_tftp->FileName,
- sizeof ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file ) );
- memcpy ( cached_info[CACHED_INFO_BINL].dhcphdr.file,
- restart_tftp->FileName,
- sizeof ( cached_info[CACHED_INFO_BINL].dhcphdr.file ) );
+ /* Intel bug-for-bug hack */
+ pxe_set_cached_filename ( restart_tftp->FileName );
/* Words cannot describe the complete mismatch between the PXE
* specification and any possible version of reality...