|  | @@ -113,12 +113,6 @@ static int pxe_tftp_xfer_deliver_iob ( struct xfer_interface *xfer __unused,
 | 
		
	
		
			
			| 113 | 113 |  	/* Calculate new buffer position */
 | 
		
	
		
			
			| 114 | 114 |  	pxe_tftp.offset += len;
 | 
		
	
		
			
			| 115 | 115 |  
 | 
		
	
		
			
			| 116 |  | -	/* Mildly ugly hack; assume that the first non-zero seek
 | 
		
	
		
			
			| 117 |  | -	 * indicates the block size.
 | 
		
	
		
			
			| 118 |  | -	 */
 | 
		
	
		
			
			| 119 |  | -	if ( pxe_tftp.blksize == 0 )
 | 
		
	
		
			
			| 120 |  | -		pxe_tftp.blksize = pxe_tftp.offset;
 | 
		
	
		
			
			| 121 |  | -
 | 
		
	
		
			
			| 122 | 116 |  	/* Record maximum offset as the file size */
 | 
		
	
		
			
			| 123 | 117 |  	if ( pxe_tftp.max_offset < pxe_tftp.offset )
 | 
		
	
		
			
			| 124 | 118 |  		pxe_tftp.max_offset = pxe_tftp.offset;
 | 
		
	
	
		
			
			|  | @@ -265,10 +259,12 @@ PXENV_EXIT_t pxenv_tftp_open ( struct s_PXENV_TFTP_OPEN *tftp_open ) {
 | 
		
	
		
			
			| 265 | 259 |  
 | 
		
	
		
			
			| 266 | 260 |  	/* Wait for OACK to arrive so that we have the block size */
 | 
		
	
		
			
			| 267 | 261 |  	while ( ( ( rc = pxe_tftp.rc ) == -EINPROGRESS ) &&
 | 
		
	
		
			
			| 268 |  | -		( pxe_tftp.blksize == 0 ) ) {
 | 
		
	
		
			
			|  | 262 | +		( pxe_tftp.max_offset == 0 ) ) {
 | 
		
	
		
			
			| 269 | 263 |  		step();
 | 
		
	
		
			
			| 270 | 264 |  	}
 | 
		
	
		
			
			|  | 265 | +	pxe_tftp.blksize = xfer_window ( &pxe_tftp.xfer );
 | 
		
	
		
			
			| 271 | 266 |  	tftp_open->PacketSize = pxe_tftp.blksize;
 | 
		
	
		
			
			|  | 267 | +	DBG ( " blksize=%d", tftp_open->PacketSize );
 | 
		
	
		
			
			| 272 | 268 |  
 | 
		
	
		
			
			| 273 | 269 |  	/* EINPROGRESS is normal; we don't wait for the whole transfer */
 | 
		
	
		
			
			| 274 | 270 |  	if ( rc == -EINPROGRESS )
 | 
		
	
	
		
			
			|  | @@ -571,6 +567,7 @@ PXENV_EXIT_t pxenv_tftp_get_fsize ( struct s_PXENV_TFTP_GET_FSIZE
 | 
		
	
		
			
			| 571 | 567 |  		step();
 | 
		
	
		
			
			| 572 | 568 |  	}
 | 
		
	
		
			
			| 573 | 569 |  	tftp_get_fsize->FileSize = pxe_tftp.max_offset;
 | 
		
	
		
			
			|  | 570 | +	DBG ( " fsize=%d", tftp_get_fsize->FileSize );
 | 
		
	
		
			
			| 574 | 571 |  
 | 
		
	
		
			
			| 575 | 572 |  	/* EINPROGRESS is normal; we don't wait for the whole transfer */
 | 
		
	
		
			
			| 576 | 573 |  	if ( rc == -EINPROGRESS )
 |