[PATCH 3/3] net: dhcp: add global variable for retries

Sascha Hauer s.hauer at pengutronix.de
Mon Sep 3 23:12:32 PDT 2018


Hi Oleg,

On Fri, Aug 31, 2018 at 09:01:32AM +0000, Oleg.Karfich at wago.com wrote:
> Signed-off-by: Oleg Karfich <oleg.karfich at wago.com>
> ---
>  net/dhcp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/dhcp.c b/net/dhcp.c
> index 6394397..92e0501 100644
> --- a/net/dhcp.c
> +++ b/net/dhcp.c
> @@ -448,6 +448,7 @@ static char *global_dhcp_bootfile;
>  static char *global_dhcp_oftree_file;
>  static char *global_dhcp_rootpath;
>  static char *global_dhcp_tftp_server_name;
> +static char *global_dhcp_retries;
>  static char *global_dhcp_option224;
>  
>  static void set_res(char **var, const char *res)
> @@ -629,6 +630,7 @@ static int dhcp_global_init(void)
>  	globalvar_add_simple_string("dhcp.user_class", &global_dhcp_user_class);
>  	globalvar_add_simple_string("dhcp.oftree_file", &global_dhcp_oftree_file);
>  	globalvar_add_simple_string("dhcp.tftp_server_name", &global_dhcp_tftp_server_name);
> +	globalvar_add_simple_string("dhcp.retries", &global_dhcp_retries);

This adds a global variable, but it is not used, so this still has no
effect. Turn this into globalvar_add_simple_int(). The int * you pass
should then be used instead of DHCP_DEFAULT_RETRY to initialize
dhcp_param.retries in dhcp_request().

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list