mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 21:41:43 +03:00
Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe
This commit is contained in:
@@ -368,11 +368,11 @@ static size_t dhcp_field_len ( const void *data, size_t max_len ) {
|
||||
* @v max_len Field length
|
||||
* @v tag DHCP option tag, or 0
|
||||
*
|
||||
* If @c tag is non-zero, the field will be treated as a
|
||||
* NUL-terminated string representing the value of the specified DHCP
|
||||
* option. If @c tag is zero, the field will be treated as a block of
|
||||
* DHCP options, and simply appended to the existing options in the
|
||||
* option block.
|
||||
* If @c tag is non-zero (and the field is not empty), the field will
|
||||
* be treated as a NUL-terminated string representing the value of the
|
||||
* specified DHCP option. If @c tag is zero, the field will be
|
||||
* treated as a block of DHCP options, and simply appended to the
|
||||
* existing options in the option block.
|
||||
*
|
||||
* The caller must ensure that there is enough space in the options
|
||||
* block to perform the merge.
|
||||
@@ -385,7 +385,9 @@ static void merge_dhcp_field ( struct dhcp_option_block *options,
|
||||
struct dhcp_option *end;
|
||||
|
||||
if ( tag ) {
|
||||
set_dhcp_option ( options, tag, data, strlen ( data ) );
|
||||
len = strlen ( data );
|
||||
if ( len )
|
||||
set_dhcp_option ( options, tag, data, len );
|
||||
} else {
|
||||
len = dhcp_field_len ( data, max_len );
|
||||
dest = ( options->data + options->len - 1 );
|
||||
@@ -925,8 +927,8 @@ static int dhcp_deliver_raw ( struct xfer_interface *xfer,
|
||||
static struct xfer_interface_operations dhcp_xfer_operations = {
|
||||
.close = ignore_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.seek = ignore_xfer_seek,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = xfer_deliver_as_raw,
|
||||
.deliver_raw = dhcp_deliver_raw,
|
||||
};
|
||||
|
||||
@@ -435,7 +435,6 @@ static void dns_xfer_close ( struct xfer_interface *socket, int rc ) {
|
||||
static struct xfer_interface_operations dns_socket_operations = {
|
||||
.close = dns_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.seek = ignore_xfer_seek,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = xfer_deliver_as_raw,
|
||||
|
||||
@@ -703,6 +703,7 @@ static int tftp_rx_oack ( struct tftp_request *tftp, void *buf, size_t len ) {
|
||||
static int tftp_rx_data ( struct tftp_request *tftp,
|
||||
struct io_buffer *iobuf ) {
|
||||
struct tftp_data *data = iobuf->data;
|
||||
struct xfer_metadata meta;
|
||||
int block;
|
||||
off_t offset;
|
||||
size_t data_len;
|
||||
@@ -729,8 +730,10 @@ static int tftp_rx_data ( struct tftp_request *tftp,
|
||||
}
|
||||
|
||||
/* Deliver data */
|
||||
xfer_seek ( &tftp->xfer, offset, SEEK_SET );
|
||||
rc = xfer_deliver_iob ( &tftp->xfer, iobuf );
|
||||
memset ( &meta, 0, sizeof ( meta ) );
|
||||
meta.whence = SEEK_SET;
|
||||
meta.offset = offset;
|
||||
rc = xfer_deliver_iob_meta ( &tftp->xfer, iobuf, &meta );
|
||||
iobuf = NULL;
|
||||
if ( rc != 0 ) {
|
||||
DBGC ( tftp, "TFTP %p could not deliver data: %s\n",
|
||||
@@ -909,7 +912,6 @@ static int tftp_socket_deliver_iob ( struct xfer_interface *socket,
|
||||
static struct xfer_interface_operations tftp_socket_operations = {
|
||||
.close = ignore_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.seek = ignore_xfer_seek,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = tftp_socket_deliver_iob,
|
||||
@@ -937,7 +939,6 @@ static int tftp_mc_socket_deliver_iob ( struct xfer_interface *mc_socket,
|
||||
static struct xfer_interface_operations tftp_mc_socket_operations = {
|
||||
.close = ignore_xfer_close,
|
||||
.vredirect = xfer_vopen,
|
||||
.seek = ignore_xfer_seek,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = tftp_mc_socket_deliver_iob,
|
||||
@@ -964,7 +965,6 @@ static void tftp_xfer_close ( struct xfer_interface *xfer, int rc ) {
|
||||
static struct xfer_interface_operations tftp_xfer_operations = {
|
||||
.close = tftp_xfer_close,
|
||||
.vredirect = ignore_xfer_vredirect,
|
||||
.seek = ignore_xfer_seek,
|
||||
.window = unlimited_xfer_window,
|
||||
.alloc_iob = default_xfer_alloc_iob,
|
||||
.deliver_iob = xfer_deliver_as_raw,
|
||||
|
||||
Reference in New Issue
Block a user