| 
				
			 | 
			
			
				
				@@ -12,6 +12,7 @@ 
			 | 
		
		
	
		
			
			| 
				12
			 | 
			
				12
			 | 
			
			
				
				 #include <ipxe/xfer.h> 
			 | 
		
		
	
		
			
			| 
				13
			 | 
			
				13
			 | 
			
			
				
				 #include <ipxe/open.h> 
			 | 
		
		
	
		
			
			| 
				14
			 | 
			
				14
			 | 
			
			
				
				 #include <ipxe/uri.h> 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				15
			 | 
			
			
				
				+#include <ipxe/netdevice.h> 
			 | 
		
		
	
		
			
			| 
				15
			 | 
			
				16
			 | 
			
			
				
				 #include <ipxe/tcpip.h> 
			 | 
		
		
	
		
			
			| 
				16
			 | 
			
				17
			 | 
			
			
				
				 #include <ipxe/tcp.h> 
			 | 
		
		
	
		
			
			| 
				17
			 | 
			
				18
			 | 
			
			
				
				  
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -483,14 +484,14 @@ static int tcp_xmit ( struct tcp_connection *tcp ) { 
			 | 
		
		
	
		
			
			| 
				483
			 | 
			
				484
			 | 
			
			
				
				 		start_timer ( &tcp->timer ); 
			 | 
		
		
	
		
			
			| 
				484
			 | 
			
				485
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				485
			 | 
			
				486
			 | 
			
			
				
				 	/* Allocate I/O buffer */ 
			 | 
		
		
	
		
			
			| 
				486
			 | 
			
				
			 | 
			
			
				
				-	iobuf = alloc_iob ( len + MAX_HDR_LEN ); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				487
			 | 
			
			
				
				+	iobuf = alloc_iob ( len + MAX_LL_NET_HEADER_LEN ); 
			 | 
		
		
	
		
			
			| 
				487
			 | 
			
				488
			 | 
			
			
				
				 	if ( ! iobuf ) { 
			 | 
		
		
	
		
			
			| 
				488
			 | 
			
				489
			 | 
			
			
				
				 		DBGC ( tcp, "TCP %p could not allocate iobuf for %08x..%08x " 
			 | 
		
		
	
		
			
			| 
				489
			 | 
			
				490
			 | 
			
			
				
				 		       "%08x\n", tcp, tcp->snd_seq, ( tcp->snd_seq + seq_len ), 
			 | 
		
		
	
		
			
			| 
				490
			 | 
			
				491
			 | 
			
			
				
				 		       tcp->rcv_ack ); 
			 | 
		
		
	
		
			
			| 
				491
			 | 
			
				492
			 | 
			
			
				
				 		return -ENOMEM; 
			 | 
		
		
	
		
			
			| 
				492
			 | 
			
				493
			 | 
			
			
				
				 	} 
			 | 
		
		
	
		
			
			| 
				493
			 | 
			
				
			 | 
			
			
				
				-	iob_reserve ( iobuf, MAX_HDR_LEN ); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				494
			 | 
			
			
				
				+	iob_reserve ( iobuf, MAX_LL_NET_HEADER_LEN ); 
			 | 
		
		
	
		
			
			| 
				494
			 | 
			
				495
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				495
			 | 
			
				496
			 | 
			
			
				
				 	/* Fill data payload from transmit queue */ 
			 | 
		
		
	
		
			
			| 
				496
			 | 
			
				497
			 | 
			
			
				
				 	tcp_process_tx_queue ( tcp, len, iobuf, 0 ); 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -627,14 +628,14 @@ static int tcp_xmit_reset ( struct tcp_connection *tcp, 
			 | 
		
		
	
		
			
			| 
				627
			 | 
			
				628
			 | 
			
			
				
				 	int rc; 
			 | 
		
		
	
		
			
			| 
				628
			 | 
			
				629
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				629
			 | 
			
				630
			 | 
			
			
				
				 	/* Allocate space for dataless TX buffer */ 
			 | 
		
		
	
		
			
			| 
				630
			 | 
			
				
			 | 
			
			
				
				-	iobuf = alloc_iob ( MAX_HDR_LEN ); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				631
			 | 
			
			
				
				+	iobuf = alloc_iob ( MAX_LL_NET_HEADER_LEN ); 
			 | 
		
		
	
		
			
			| 
				631
			 | 
			
				632
			 | 
			
			
				
				 	if ( ! iobuf ) { 
			 | 
		
		
	
		
			
			| 
				632
			 | 
			
				633
			 | 
			
			
				
				 		DBGC ( tcp, "TCP %p could not allocate iobuf for RST " 
			 | 
		
		
	
		
			
			| 
				633
			 | 
			
				634
			 | 
			
			
				
				 		       "%08x..%08x %08x\n", tcp, ntohl ( in_tcphdr->ack ), 
			 | 
		
		
	
		
			
			| 
				634
			 | 
			
				635
			 | 
			
			
				
				 		       ntohl ( in_tcphdr->ack ), ntohl ( in_tcphdr->seq ) ); 
			 | 
		
		
	
		
			
			| 
				635
			 | 
			
				636
			 | 
			
			
				
				 		return -ENOMEM; 
			 | 
		
		
	
		
			
			| 
				636
			 | 
			
				637
			 | 
			
			
				
				 	} 
			 | 
		
		
	
		
			
			| 
				637
			 | 
			
				
			 | 
			
			
				
				-	iob_reserve ( iobuf, MAX_HDR_LEN ); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				638
			 | 
			
			
				
				+	iob_reserve ( iobuf, MAX_LL_NET_HEADER_LEN ); 
			 | 
		
		
	
		
			
			| 
				638
			 | 
			
				639
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				639
			 | 
			
				640
			 | 
			
			
				
				 	/* Construct RST response */ 
			 | 
		
		
	
		
			
			| 
				640
			 | 
			
				641
			 | 
			
			
				
				 	tcphdr = iob_push ( iobuf, sizeof ( *tcphdr ) ); 
			 |