瀏覽代碼

[pxe] Remove pxe_set_cached_filename()

gPXE currently overwrites the filename stored in the cached DHCP
packets when a call to PXENV_TFTP_READ_FILE or PXENV_RESTART_TFTP is
made.  This code has existed for many years as a workaround for RIS,
which seemed to require that this be done.

pxe_set_cached_filename() causes problems with the Bootix NBP, and a
recent test demonstrates that RIS will complete successfully even with
pxe_set_cached_filename() removed.  There have been many changes to
the DHCP and PXE logic since this code was first added, and it is
quite plausible that it was masking a bug that no longer exists.

Reported-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Debugged-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
tags/v1.20.1
Michael Brown 14 年之前
父節點
當前提交
80d1ac7320
共有 3 個檔案被更改,包括 0 行新增37 行删除
  1. 0
    2
      src/arch/i386/include/pxe.h
  2. 0
    21
      src/arch/i386/interface/pxe/pxe_preboot.c
  3. 0
    14
      src/arch/i386/interface/pxe/pxe_tftp.c

+ 0
- 2
src/arch/i386/include/pxe.h 查看文件

149
 
149
 
150
 extern void pxe_set_netdev ( struct net_device *netdev );
150
 extern void pxe_set_netdev ( struct net_device *netdev );
151
 
151
 
152
-extern void pxe_set_cached_filename ( const unsigned char *filename );
153
-
154
 #endif /* PXE_H */
152
 #endif /* PXE_H */

+ 0
- 21
src/arch/i386/interface/pxe/pxe_preboot.c 查看文件

102
 static union pxe_cached_info __bss16_array ( cached_info, [NUM_CACHED_INFOS] );
102
 static union pxe_cached_info __bss16_array ( cached_info, [NUM_CACHED_INFOS] );
103
 #define cached_info __use_data16 ( cached_info )
103
 #define cached_info __use_data16 ( cached_info )
104
 
104
 
105
-/**
106
- * Set PXE cached TFTP filename
107
- *
108
- * @v filename		TFTP filename
109
- *
110
- * This is a bug-for-bug compatibility hack needed in order to work
111
- * with Microsoft Remote Installation Services (RIS).  The filename
112
- * used in a call to PXENV_RESTART_TFTP or PXENV_TFTP_READ_FILE must
113
- * be returned as the DHCP filename in subsequent calls to
114
- * PXENV_GET_CACHED_INFO.
115
- */
116
-void pxe_set_cached_filename ( const unsigned char *filename ) {
117
-	memcpy ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file, filename,
118
-		 sizeof ( cached_info[CACHED_INFO_DHCPACK].dhcphdr.file ) );
119
-	memcpy ( cached_info[CACHED_INFO_BINL].dhcphdr.file, filename,
120
-		 sizeof ( cached_info[CACHED_INFO_BINL].dhcphdr.file ) );
121
-}
122
-
123
 /**
105
 /**
124
  * UNLOAD BASE CODE STACK
106
  * UNLOAD BASE CODE STACK
125
  *
107
  *
236
 
218
 
237
 	DBG ( "PXENV_RESTART_TFTP " );
219
 	DBG ( "PXENV_RESTART_TFTP " );
238
 
220
 
239
-	/* Intel bug-for-bug hack */
240
-	pxe_set_cached_filename ( restart_tftp->FileName );
241
-
242
 	/* Words cannot describe the complete mismatch between the PXE
221
 	/* Words cannot describe the complete mismatch between the PXE
243
 	 * specification and any possible version of reality...
222
 	 * specification and any possible version of reality...
244
 	 */
223
 	 */

+ 0
- 14
src/arch/i386/interface/pxe/pxe_tftp.c 查看文件

171
 	struct in_addr address;
171
 	struct in_addr address;
172
 	int rc;
172
 	int rc;
173
 
173
 
174
-	/* Intel bug-for-bug hack */
175
-	pxe_set_cached_filename ( filename );
176
-
177
 	/* Reset PXE TFTP connection structure */
174
 	/* Reset PXE TFTP connection structure */
178
 	memset ( &pxe_tftp, 0, sizeof ( pxe_tftp ) );
175
 	memset ( &pxe_tftp, 0, sizeof ( pxe_tftp ) );
179
 	xfer_init ( &pxe_tftp.xfer, &pxe_tftp_xfer_ops, NULL );
176
 	xfer_init ( &pxe_tftp.xfer, &pxe_tftp_xfer_ops, NULL );
470
  * value before calling this function in protected mode.  You cannot
467
  * value before calling this function in protected mode.  You cannot
471
  * call this function with a 32-bit stack segment.  (See the relevant
468
  * call this function with a 32-bit stack segment.  (See the relevant
472
  * @ref pxe_x86_pmode16 "implementation note" for more details.)
469
  * @ref pxe_x86_pmode16 "implementation note" for more details.)
473
- *
474
- * @note Microsoft's NTLDR assumes that the filename passed in via
475
- * s_PXENV_TFTP_READ_FILE::FileName will be stored in the "file" field
476
- * of the stored DHCPACK packet, whence it will be returned via any
477
- * subsequent calls to pxenv_get_cached_info().  Though this is
478
- * essentially a bug in the Intel PXE implementation (not, for once,
479
- * in the specification!), it is a bug that Microsoft relies upon, and
480
- * so we implement this bug-for-bug compatibility by overwriting the
481
- * filename stored DHCPACK packet with the filename passed in
482
- * s_PXENV_TFTP_READ_FILE::FileName.
483
- *
484
  */
470
  */
485
 PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
471
 PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
486
 				    *tftp_read_file ) {
472
 				    *tftp_read_file ) {

Loading…
取消
儲存