|  | @@ -622,7 +622,7 @@ static int dhcp_send_request ( struct dhcp_session *dhcp ) {
 | 
		
	
		
			
			| 622 | 622 |  		.netdev = dhcp->netdev,
 | 
		
	
		
			
			| 623 | 623 |  	};
 | 
		
	
		
			
			| 624 | 624 |  	struct io_buffer *iobuf;
 | 
		
	
		
			
			| 625 |  | -	struct dhcp_packet *dhcpoffer;
 | 
		
	
		
			
			|  | 625 | +	struct dhcp_packet *dhcpoffer = NULL;
 | 
		
	
		
			
			| 626 | 626 |  	struct dhcp_packet dhcppkt;
 | 
		
	
		
			
			| 627 | 627 |  	int rc;
 | 
		
	
		
			
			| 628 | 628 |  	
 | 
		
	
	
		
			
			|  | @@ -643,7 +643,10 @@ static int dhcp_send_request ( struct dhcp_session *dhcp ) {
 | 
		
	
		
			
			| 643 | 643 |  		return -ENOMEM;
 | 
		
	
		
			
			| 644 | 644 |  
 | 
		
	
		
			
			| 645 | 645 |  	/* Create DHCP packet in temporary buffer */
 | 
		
	
		
			
			| 646 |  | -	dhcpoffer = ( dhcp->response ? &dhcp->response->dhcppkt : NULL );
 | 
		
	
		
			
			|  | 646 | +	if ( dhcp->state == DHCPREQUEST ) {
 | 
		
	
		
			
			|  | 647 | +		assert ( dhcp->response );
 | 
		
	
		
			
			|  | 648 | +		dhcpoffer = &dhcp->response->dhcppkt;
 | 
		
	
		
			
			|  | 649 | +	}
 | 
		
	
		
			
			| 647 | 650 |  	if ( ( rc = create_dhcp_request ( &dhcppkt, dhcp->netdev,
 | 
		
	
		
			
			| 648 | 651 |  					  dhcpoffer, iobuf->data,
 | 
		
	
		
			
			| 649 | 652 |  					  iob_tailroom ( iobuf ) ) ) != 0 ) {
 |