summaryrefslogtreecommitdiffstats
path: root/src/net/udp/tftp.c
diff options
context:
space:
mode:
authorMichael Brown2008-01-08 17:46:55 +0100
committerMichael Brown2008-01-08 17:46:55 +0100
commitf6a8158eed215954dafb7f622f6fd345b5b473d2 (patch)
tree74c855e3fb0a953ec463bfd4b5edb0248bd93ce8 /src/net/udp/tftp.c
parentAdded the embedded pxelinux payload patch from hpa. (diff)
downloadipxe-f6a8158eed215954dafb7f622f6fd345b5b473d2.tar.gz
ipxe-f6a8158eed215954dafb7f622f6fd345b5b473d2.tar.xz
ipxe-f6a8158eed215954dafb7f622f6fd345b5b473d2.zip
Make seek information part of the xfer metadata, rather than an entirely
separate xfer method. Add missing .alloc_iob entries to several xfer_interface_operations structures.
Diffstat (limited to 'src/net/udp/tftp.c')
-rw-r--r--src/net/udp/tftp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c
index d8719ace..4d441909 100644
--- a/src/net/udp/tftp.c
+++ b/src/net/udp/tftp.c
@@ -554,6 +554,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;
@@ -580,8 +581,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",
@@ -763,7 +766,6 @@ static void tftp_socket_close ( struct xfer_interface *socket, int rc ) {
static struct xfer_interface_operations tftp_socket_operations = {
.close = tftp_socket_close,
.vredirect = xfer_vopen,
- .seek = ignore_xfer_seek,
.window = unlimited_xfer_window,
.alloc_iob = default_xfer_alloc_iob,
.deliver_iob = tftp_socket_deliver_iob,
@@ -811,7 +813,6 @@ static void tftp_mc_socket_close ( struct xfer_interface *mc_socket,
static struct xfer_interface_operations tftp_mc_socket_operations = {
.close = tftp_mc_socket_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,
@@ -838,7 +839,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,