Package: etherboot
Version: 5.4.2-1.1
Severity: important
Tags: patch

The PXE-function tftp_read_file() does not return the Buffersize as stated
in the PXE spec on page 51:

    Version 2.1 September 20, 1999
    Copyright  1998, 1999 Intel Corporation. All rights reserved.
    Preboot Execution Environment (PXE) Specification


    typedef struct s_PXENV_TFTP_READ_FILE
    {
        PXENV_STATUS Status;
        UINT8 FileName[128];
        UINT32 BufferSize;
        ADDR32 Buffer;
        IP4 ServerIPAddress;
        IP4 GatewayIPAddress;
        IP4 McastIPAddress;
        UDP_PORT TFTPClntPort;
        UDP_PORT TFTPSrvPort;
        UINT16 TFTPOpenTimeOut;
        UINT16 TFTPReopenDelay;
        } t_PXENV_TFTP_READ_FILE;


  Set before calling API Service

    FileName: Name of file to be downloaded. Null terminated.
    BufferSize: Size of the receive buffer in bytes.
    Buffer: Physical address of receive buffer.
    ServerIPAddress: IP address of TFTP server in network order.
    GatewayIPAddress: IP address of relay agent in network order.
    McastIPAddress: File multicast IP address in network order.
    TFTPClntPort: Client multicast listening port.
    TFTPSrvPort: Server multicast listening port.
    TFTPOpenTimeOut: Timeout value, in seconds, to be used for
        receiving data or ACK packets. If zero, default TFTP timeout is used.
    TFTPReopenDelay: Maximum time, in seconds, between ACK of
        last packet and new MTFTP open request.
  
  Returned from API service
    Status: See PXENV_STATUS_xxx constants.
    BufferSize: Number of bytes written into the receive buffer.



The attached patch correct this.


    Bernhard Kauer
--- pxe_export.c.old    2006-04-19 04:03:42.000000000 +0200
+++ pxe_export.c        2007-03-09 15:52:00.000000000 +0100
@@ -871,6 +871,7 @@
                tftp_read_file->Status = PXENV_STATUS_FAILURE;
                return PXENV_EXIT_FAILURE;
        }
+       tftp_read_file->BufferSize = pxe_stack->readfile.offset;
        tftp_read_file->Status = PXENV_STATUS_SUCCESS;
        return PXENV_EXIT_SUCCESS;
 }

Reply via email to