aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2007-06-29 20:16:30 +0100
committerMichael Brown <mcb30@etherboot.org>2007-06-29 20:16:30 +0100
commit9125070f510b3908303ae4ac2ad0a8362aa96d09 (patch)
treebe1e185fdf197352094b557645954eb41140a21b /src
parent40d6d3dcf4b283272d3bd8166164b4622a85530b (diff)
downloadipxe-9125070f510b3908303ae4ac2ad0a8362aa96d09.zip
ipxe-9125070f510b3908303ae4ac2ad0a8362aa96d09.tar.gz
ipxe-9125070f510b3908303ae4ac2ad0a8362aa96d09.tar.bz2
I really, really screwed up the semantics of BufferSize and BufferLimit.
Diffstat (limited to 'src')
-rw-r--r--src/interface/pxe/pxe_preboot.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/interface/pxe/pxe_preboot.c b/src/interface/pxe/pxe_preboot.c
index 862c0dd..a1b1636 100644
--- a/src/interface/pxe/pxe_preboot.c
+++ b/src/interface/pxe/pxe_preboot.c
@@ -82,21 +82,22 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
DBG ( "PXENV_GET_CACHED_INFO %d", get_cached_info->PacketType );
+ DBG ( " to %04x:%04x+%x", get_cached_info->Buffer.segment,
+ get_cached_info->Buffer.offset, get_cached_info->BufferSize );
+
/* This is really, really awkward to support with our multiple
* sources of options.
*/
- if ( get_cached_info->BufferLimit == 0 ) {
+ len = get_cached_info->BufferSize;
+ if ( len == 0 ) {
+ len = sizeof ( dhcp_basemem );
get_cached_info->Buffer.segment = rm_ds;
get_cached_info->Buffer.offset =
( unsigned int ) ( & __from_data16 ( dhcp_basemem ) );
- get_cached_info->BufferLimit = sizeof ( dhcp_basemem );
+ get_cached_info->BufferLimit = len;
}
- DBG ( " to %04x:%04x+%x", get_cached_info->Buffer.segment,
- get_cached_info->Buffer.offset, get_cached_info->BufferLimit );
-
/* Allocate space for temporary copy */
- len = get_cached_info->BufferLimit;
data = malloc ( len );
if ( ! data ) {
DBG ( " out of memory" );