Browse Source

[pxe] Always allow MAX_LL_HEADER_LEN for the link-layer header

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
fb78d086f1
1 changed files with 2 additions and 4 deletions
  1. 2
    4
      src/arch/i386/interface/pxe/pxe_undi.c

+ 2
- 4
src/arch/i386/interface/pxe/pxe_undi.c View File

@@ -228,7 +228,6 @@ PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
228 228
 	struct ll_protocol *ll_protocol = pxe_netdev->ll_protocol;
229 229
 	char destaddr[MAX_LL_ADDR_LEN];
230 230
 	const void *ll_dest;
231
-	size_t ll_hlen = ll_protocol->ll_header_len;
232 231
 	size_t len;
233 232
 	unsigned int i;
234 233
 	int rc;
@@ -248,7 +247,6 @@ PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
248 247
 	case P_RARP:	net_protocol = &rarp_protocol;	break;
249 248
 	case P_UNKNOWN:
250 249
 		net_protocol = NULL;
251
-		ll_hlen = 0;
252 250
 		break;
253 251
 	default:
254 252
 		DBG2 ( " %02x invalid protocol\n", undi_transmit->Protocol );
@@ -271,13 +269,13 @@ PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
271 269
 	}
272 270
 
273 271
 	/* Allocate and fill I/O buffer */
274
-	iobuf = alloc_iob ( ll_hlen + len );
272
+	iobuf = alloc_iob ( MAX_LL_HEADER_LEN + len );
275 273
 	if ( ! iobuf ) {
276 274
 		DBG2 ( " could not allocate iobuf\n" );
277 275
 		undi_transmit->Status = PXENV_STATUS_OUT_OF_RESOURCES;
278 276
 		return PXENV_EXIT_FAILURE;
279 277
 	}
280
-	iob_reserve ( iobuf, ll_hlen );
278
+	iob_reserve ( iobuf, MAX_LL_HEADER_LEN );
281 279
 	copy_from_real ( iob_put ( iobuf, tbd.ImmedLength ), tbd.Xmit.segment,
282 280
 			 tbd.Xmit.offset, tbd.ImmedLength );
283 281
 	for ( i = 0 ; i < tbd.DataBlkCount ; i++ ) {

Loading…
Cancel
Save