summaryrefslogtreecommitdiffstats
path: root/src/interface
diff options
context:
space:
mode:
authorMichael Brown2007-06-30 16:13:18 +0200
committerMichael Brown2007-06-30 16:13:18 +0200
commitd05d8edd428efeff6c08dbd2423572de8e89ce06 (patch)
treed04722c8b65adf776009f450cdd41dff05f6493e /src/interface
parentSeparate out pxe_start_nbp() from pxe_image.c into pxe_call.c (diff)
downloadipxe-d05d8edd428efeff6c08dbd2423572de8e89ce06.tar.gz
ipxe-d05d8edd428efeff6c08dbd2423572de8e89ce06.tar.xz
ipxe-d05d8edd428efeff6c08dbd2423572de8e89ce06.zip
Implement the "overwrite TFTP filename" Microsoft RIS bug workaround.
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/pxe/pxe_preboot.c23
-rw-r--r--src/interface/pxe/pxe_tftp.c3
2 files changed, 23 insertions, 3 deletions
diff --git a/src/interface/pxe/pxe_preboot.c b/src/interface/pxe/pxe_preboot.c
index b1cc39c0a..3cbbf2260 100644
--- a/src/interface/pxe/pxe_preboot.c
+++ b/src/interface/pxe/pxe_preboot.c
@@ -32,6 +32,15 @@
#include "pxe.h"
#include "pxe_call.h"
+/** Filename used for last TFTP request
+ *
+ * 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.
+ */
+static char *pxe_ris_filename = NULL;
+
/**
* UNLOAD BASE CODE STACK
*
@@ -122,6 +131,12 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
goto err;
}
+ /* Overwrite filename to work around Microsoft RIS bug */
+ if ( pxe_ris_filename ) {
+ strncpy ( dhcppkt.dhcphdr->file, pxe_ris_filename,
+ sizeof ( dhcppkt.dhcphdr->file ) );
+ }
+
/* Copy packet to client buffer */
buffer = real_to_user ( get_cached_info->Buffer.segment,
get_cached_info->Buffer.offset );
@@ -150,6 +165,14 @@ PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE
DBG ( "PXENV_RESTART_TFTP " );
+ /* Work around Microsoft RIS bug */
+ free ( pxe_ris_filename );
+ pxe_ris_filename = strdup ( ( char * ) restart_tftp->FileName );
+ if ( ! pxe_ris_filename ) {
+ restart_tftp->Status = PXENV_STATUS_OUT_OF_RESOURCES;
+ return PXENV_EXIT_FAILURE;
+ }
+
/* Words cannot describe the complete mismatch between the PXE
* specification and any possible version of reality...
*/
diff --git a/src/interface/pxe/pxe_tftp.c b/src/interface/pxe/pxe_tftp.c
index 56529b155..44fb820e5 100644
--- a/src/interface/pxe/pxe_tftp.c
+++ b/src/interface/pxe/pxe_tftp.c
@@ -65,9 +65,6 @@ static void pxe_tftp_build_uri ( char *uri_string,
int blksize ) {
struct in_addr address;
- /* This is a fix to make Microsoft Remote Install Services work (RIS) */
-#warning "Overwrite DHCP filename"
-
address.s_addr = ipaddress;
if ( ! port )
port = htons ( TFTP_PORT );