Browse Source

I really, really screwed up the semantics of BufferSize and BufferLimit.

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
9125070f51
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      src/interface/pxe/pxe_preboot.c

+ 7
- 6
src/interface/pxe/pxe_preboot.c View File

@@ -82,21 +82,22 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
82 82
 
83 83
 	DBG ( "PXENV_GET_CACHED_INFO %d", get_cached_info->PacketType );
84 84
 
85
+	DBG ( " to %04x:%04x+%x", get_cached_info->Buffer.segment,
86
+	      get_cached_info->Buffer.offset, get_cached_info->BufferSize );
87
+
85 88
 	/* This is really, really awkward to support with our multiple
86 89
 	 * sources of options.
87 90
 	 */
88
-	if ( get_cached_info->BufferLimit == 0 ) {
91
+	len = get_cached_info->BufferSize;
92
+	if ( len == 0 ) {
93
+		len = sizeof ( dhcp_basemem );
89 94
 		get_cached_info->Buffer.segment = rm_ds;
90 95
 		get_cached_info->Buffer.offset =
91 96
 			( unsigned int ) ( & __from_data16 ( dhcp_basemem ) );
92
-		get_cached_info->BufferLimit = sizeof ( dhcp_basemem );
97
+		get_cached_info->BufferLimit = len;
93 98
 	}
94 99
 
95
-	DBG ( " to %04x:%04x+%x", get_cached_info->Buffer.segment,
96
-	      get_cached_info->Buffer.offset, get_cached_info->BufferLimit );
97
-
98 100
 	/* Allocate space for temporary copy */
99
-	len = get_cached_info->BufferLimit;
100 101
 	data = malloc ( len );
101 102
 	if ( ! data ) {
102 103
 		DBG ( " out of memory" );

Loading…
Cancel
Save