From: Sascha Hauer <s.hauer@pengutronix.de>
To: Oleg.Karfich@wago.com
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] net: dhcp: add global variable for retries
Date: Tue, 4 Sep 2018 10:09:38 +0200 [thread overview]
Message-ID: <20180904080938.5tnymhxah4wj2ezd@pengutronix.de> (raw)
In-Reply-To: <1536044850-23483-1-git-send-email-oleg.karfich@wago.com>
On Tue, Sep 04, 2018 at 07:07:37AM +0000, Oleg.Karfich@wago.com wrote:
> Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
> ---
>
> Changes in v2:
>
> - use globalvar_add_simple_int
> - set default value to global variable
> - and use the global variable in dhcp requests :-)
>
> ---
This is not exactly a v2 but a fixup for the original patch. Squashed
the to patches into one and applied, thanks
Sascha
> net/dhcp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/dhcp.c b/net/dhcp.c
> index 92e0501..984d32a 100644
> --- a/net/dhcp.c
> +++ b/net/dhcp.c
> @@ -448,7 +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 int global_dhcp_retries = DHCP_DEFAULT_RETRY;
> static char *global_dhcp_option224;
>
> static void set_res(char **var, const char *res)
> @@ -485,7 +485,7 @@ int dhcp_request(struct eth_device *edev, const struct dhcp_req_param *param,
> if (!dhcp_param.option224)
> dhcp_param.option224 = global_dhcp_option224;
> if (!dhcp_param.retries)
> - dhcp_param.retries = DHCP_DEFAULT_RETRY;
> + dhcp_param.retries = global_dhcp_retries;
>
> dhcp_con = net_udp_eth_new(edev, IP_BROADCAST, PORT_BOOTPS, dhcp_handler, NULL);
> if (IS_ERR(dhcp_con)) {
> @@ -630,7 +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);
> + globalvar_add_simple_int("dhcp.retries", &global_dhcp_retries, "%u");
> globalvar_add_simple_string("dhcp.option224", &global_dhcp_option224);
>
> return 0;
> --
> 2.7.4
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-09-04 8:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-04 7:07 Oleg.Karfich
2018-09-04 8:09 ` Sascha Hauer [this message]
2018-09-04 8:34 ` Oleg.Karfich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180904080938.5tnymhxah4wj2ezd@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=Oleg.Karfich@wago.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox