[PATCH 07/19] udhcpc: make udhcpc silent after 3 'Sending discover ...' messages

Denys Vlasenko vda.linux at googlemail.com
Thu Sep 27 14:30:29 UTC 2012


On Tue, Sep 25, 2012 at 2:06 PM, Florian Fainelli <florian at alphacore.org> wrote:
> From: Felix Fietkau <nbd at openwrt.org>
>
> Signed-off-by: Felix Fietkau <nbd at openwrt.org>
> ---
>  networking/udhcp/dhcpc.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
> index f72217c..f1013f4 100644
> --- a/networking/udhcp/dhcpc.c
> +++ b/networking/udhcp/dhcpc.c
> @@ -672,6 +672,7 @@ static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet)
>  static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
>  {
>         struct dhcp_packet packet;
> +       static int msgs = 0;

Why static?

>         /* Fill in: op, htype, hlen, cookie, chaddr fields,
>          * random xid field (we override it below),
> @@ -689,7 +690,8 @@ static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
>          */
>         add_client_options(&packet);
>
> -       bb_info_msg("Sending discover...");
> +       if (msgs++ < 3)
> +               bb_info_msg("Sending discover...");
>         return raw_bcast_from_client_config_ifindex(&packet);
>  }

Why do you want to suppress the message?


More information about the busybox mailing list