[U-Boot] [PATCH 2/2] efi_loader: set the dhcp ack received flag

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Mar 23 19:04:27 UTC 2018


On 03/23/2018 08:01 PM, Heinrich Schuchardt wrote:
>>From 689ada7663efae5ef13d021f3266e081d1d53293 Mon Sep 17 00:00:00 2001
> From: Patrick Wildt <patrick at blueri.se>
> Date: Fri, 23 Mar 2018 15:38:48 +0100
> Subject: [PATCH 2/2] efi_loader: set the dhcp ack received flag
> 
> The PXE object contains a flag that specifies whether or not a DHCP
> ACK has been received.  This might be used by programs to find out
> whether or not it is worth to read the DHCP information ot ouf our
> object.
> 

Why should we implement this change now without a consumer for the
information?

> Signed-off-by: Patrick Wildt <patrick at blueri.se>
> ---
>  include/efi_api.h        | 4 +++-
>  lib/efi_loader/efi_net.c | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/efi_api.h b/include/efi_api.h
> index 3ba650e57e..7dfa17f5c6 100644
> --- a/include/efi_api.h
> +++ b/include/efi_api.h
> @@ -756,7 +756,9 @@ struct efi_pxe_packet {
> 
>  struct efi_pxe_mode
>  {
> -	u8 unused[52];
> +	u8 unused1[9];
> +	u8 dhcp_ack_received;

Why use a byte in the middle of the unused region?

Best regards

Heinrich

> +	u8 unused2[42];
>  	struct efi_pxe_packet dhcp_discover;
>  	struct efi_pxe_packet dhcp_ack;
>  	struct efi_pxe_packet proxy_offer;
> diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
> index 8c5d5b492c..0b9c7b9345 100644
> --- a/lib/efi_loader/efi_net.c
> +++ b/lib/efi_loader/efi_net.c
> @@ -332,8 +332,10 @@ int efi_net_register(void)
>  	netobj->net_mode.max_packet_size = PKTSIZE;
> 
>  	netobj->pxe.mode = &netobj->pxe_mode;
> -	if (dhcp_ack)
> +	if (dhcp_ack) {
>  		netobj->pxe_mode.dhcp_ack = *dhcp_ack;
> +		netobj->pxe_mode.dhcp_ack_received = 1;
> +	}
> 
>  	/*
>  	 * Create WaitForPacket event.
> 



More information about the U-Boot mailing list