($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Michael Johnson <mjohnson459 at gmail.com>
To: ell at lists.01.org
Subject: Re: [PATCH] dhcp: Use bound_time for retransmission timers
Date: Fri, 13 May 2022 14:53:42 +0100	[thread overview]
Message-ID: <CACsRnHW6LNDMxhrZB-_7JAH3h3Q54D9vUqf-YJhfEg4FgBC-gA@mail.gmail.com> (raw)
In-Reply-To: 20220511172855.25992-1-denkenz@gmail.com

[-- Attachment #1: Type: text/plain, Size: 3183 bytes --]

Hi Denis,

I've been running this patch for the day and I don't think it's
actually fixed the retry. I have set a low lease time and then block
the DHCP server for the ACK and I can see that the retry still doesn't
happen.

https://pastebin.com/Gy3Gcs4W

Regards,
Michael

On Wed, 11 May 2022 at 18:29, Denis Kenzior <denkenz(a)gmail.com> wrote:
>
> start_t is used to try and calculate the retransmission timeout value
> when the client enters RENEWING or REBINDING state.  This works fine on
> the first renewal since the client start timestamp and the lease bound
> timestamp are very close.  Also, the RENEW request is sent immediately
> whenever the T1 timer expires and most of the time it succeeds.
>
> However, if this isn't a first renewal attempt and the RENEW request
> sent when the T1 timer expires is not successful, then the renewal
> timeout value could become too large.  Fix that by using the lease
> bound_time for the retransmission timer calculation (as intended) intead
> of the client start time (start_t).
> ---
>  ell/dhcp.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/ell/dhcp.c b/ell/dhcp.c
> index 2d049005a135..01900f3b1d38 100644
> --- a/ell/dhcp.c
> +++ b/ell/dhcp.c
> @@ -520,6 +520,7 @@ static void dhcp_client_timeout_resend(struct l_timeout *timeout,
>                                                                 void *user_data)
>  {
>         struct l_dhcp_client *client = user_data;
> +       struct l_dhcp_lease *lease = client->lease;
>         unsigned int next_timeout = 0;
>         int r;
>
> @@ -555,12 +556,12 @@ static void dhcp_client_timeout_resend(struct l_timeout *timeout,
>
>         switch (client->state) {
>         case DHCP_STATE_RENEWING:
> -               next_timeout = dhcp_rebind_renew_retry_time(client->start_t,
> -                                                       client->lease->t2);
> +               next_timeout = dhcp_rebind_renew_retry_time(lease->bound_time,
> +                                                               lease->t2);
>                 break;
>         case DHCP_STATE_REBINDING:
> -               next_timeout = dhcp_rebind_renew_retry_time(client->start_t,
> -                                               client->lease->lifetime);
> +               next_timeout = dhcp_rebind_renew_retry_time(lease->bound_time,
> +                                                       lease->lifetime);
>                 break;
>         case DHCP_STATE_REQUESTING:
>         case DHCP_STATE_SELECTING:
> @@ -642,7 +643,7 @@ static void dhcp_client_t1_expired(struct l_timeout *timeout, void *user_data)
>         l_timeout_set_callback(client->timeout_lease, dhcp_client_t2_expired,
>                                 client, NULL);
>
> -       next_timeout = dhcp_rebind_renew_retry_time(client->start_t,
> +       next_timeout = dhcp_rebind_renew_retry_time(client->lease->bound_time,
>                                                         client->lease->t2);
>         client->timeout_resend =
>                 l_timeout_create_ms(dhcp_fuzz_secs(next_timeout),
> --
> 2.32.0
>

             reply	other threads:[~2022-05-13 13:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 13:53 Michael Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-18 16:21 [PATCH] dhcp: Use bound_time for retransmission timers Denis Kenzior
2022-05-13 17:10 Michael Johnson
2022-05-13 16:23 Denis Kenzior
2022-05-13 15:40 Michael Johnson
2022-05-13 15:31 Michael Johnson
2022-05-13 14:30 Denis Kenzior
2022-05-11 17:28 Denis Kenzior

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=CACsRnHW6LNDMxhrZB-_7JAH3h3Q54D9vUqf-YJhfEg4FgBC-gA@mail.gmail.com \
    --to=ell@lists.linux.dev \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).