2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-29 12:49:49 +00:00

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

stored DHCP packets.
This commit is contained in:
Michael Brown 2008-01-22 18:51:12 +00:00
parent 84f99f781e
commit c9c8cdeb8b
2 changed files with 22 additions and 12 deletions

View File

@ -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 */

View File

@ -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
*
@ -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...