summaryrefslogtreecommitdiffstats
path: root/src/interface
diff options
context:
space:
mode:
authorMichael Brown2010-11-19 16:32:05 +0100
committerMichael Brown2010-11-19 17:08:04 +0100
commit308615cd97ec9a17cdbd184626038ef5e5e28443 (patch)
tree9fe36a7e936d33fd59816b636b4c293d58b97654 /src/interface
parent[lotest] Move lotest.h to correct directory (diff)
downloadipxe-308615cd97ec9a17cdbd184626038ef5e5e28443.tar.gz
ipxe-308615cd97ec9a17cdbd184626038ef5e5e28443.tar.xz
ipxe-308615cd97ec9a17cdbd184626038ef5e5e28443.zip
[efi] Always allow MAX_LL_HEADER_LEN for the link-layer header
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/efi/efi_snp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c
index 01b6b506b..43620f57e 100644
--- a/src/interface/efi/efi_snp.c
+++ b/src/interface/efi/efi_snp.c
@@ -530,6 +530,7 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
container_of ( snp, struct efi_snp_device, snp );
struct ll_protocol *ll_protocol = snpdev->netdev->ll_protocol;
struct io_buffer *iobuf;
+ size_t ll_headroom;
int rc;
EFI_STATUS efirc;
@@ -582,13 +583,15 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
}
/* Allocate buffer */
- iobuf = alloc_iob ( len );
+ ll_headroom = ( MAX_LL_HEADER_LEN - ll_header_len );
+ iobuf = alloc_iob ( ll_headroom + len );
if ( ! iobuf ) {
DBGC ( snpdev, "SNPDEV %p TX could not allocate %ld-byte "
"buffer\n", snpdev, ( ( unsigned long ) len ) );
efirc = EFI_DEVICE_ERROR;
goto err_alloc_iob;
}
+ iob_reserve ( iobuf, ll_headroom );
memcpy ( iob_put ( iobuf, len ), data, len );
/* Create link-layer header, if specified */