Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add pxe_set_cached_filename() so that pxe_tftp.c can also update the
stored DHCP packets.
  • Loading branch information
Michael Brown committed Jan 22, 2008
1 parent 84f99f7 commit c9c8cde
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/include/pxe.h
Expand Up @@ -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 */
32 changes: 20 additions & 12 deletions src/interface/pxe/pxe_preboot.c
Expand Up @@ -68,6 +68,24 @@ union pxe_cached_info {
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
*
Expand Down Expand Up @@ -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...
Expand Down

0 comments on commit c9c8cde

Please sign in to comment.