grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>,
	Sakar Arora <sakar.arora@nxp.com>
Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com>
Subject: Re: [PATCH] net/ip: Fix limit_time calculation in freeing old fragments
Date: Tue, 18 Oct 2016 20:27:37 +0300	[thread overview]
Message-ID: <c293de9b-4a67-e11f-4583-b9af0eb38ac8@gmail.com> (raw)
In-Reply-To: <VI1PR04MB2173DFA6AE234C8DF799A597F8D00@VI1PR04MB2173.eurprd04.prod.outlook.com>

Committed with trivial formatting change. Thank you!

17.10.2016 08:30, Sakar Arora пишет:
> Hi
> 
> Sending the below mentioned patch as an attachment. Please review.
> 
> Thanks,
> Sakar
> 
> -----Original Message-----
> From: Sakar Arora [mailto:sakar.arora@nxp.com] 
> Sent: Saturday, October 15, 2016 1:26 AM
> To: grub-devel@gnu.org
> Cc: Bhupesh Sharma <bhupesh.sharma@nxp.com>; Sakar Arora <sakar.arora@nxp.com>
> Subject: [PATCH] net/ip: Fix limit_time calculation in freeing old fragments
> 
> From: Sakar Arora <Sakar.Arora@nxp.com>
> 
> limit_time underflows when current time is less than 90000ms.
> This causes packet fragments received during this time, i.e., till 90000ms pass since timer init, to be rejected.
> 
> Hence, set it to 0 if its less than 90000.
> 
> Signed-off-by: Sakar Arora <Sakar.Arora@nxp.com>
> ---
>  grub-core/net/ip.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c index 8c56baa..4dae207 100644
> --- a/grub-core/net/ip.c
> +++ b/grub-core/net/ip.c
> @@ -363,7 +363,9 @@ static void
>  free_old_fragments (void)
>  {
>    struct reassemble *rsm, **prev;
> -  grub_uint64_t limit_time = grub_get_time_ms () - 90000;
> +  grub_uint64_t limit_time = grub_get_time_ms ();
> +
> +  limit_time = (limit_time > 90000)?limit_time - 90000:0;
>  
>    for (prev = &reassembles, rsm = *prev; rsm; rsm = *prev)
>      if (rsm->last_time < limit_time)
> --
> 1.9.1
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



  reply	other threads:[~2016-10-18 17:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1476474982-7603-1-git-send-email-sakar.arora@nxp.com>
2016-10-17  5:30 ` [PATCH] net/ip: Fix limit_time calculation in freeing old fragments Sakar Arora
2016-10-18 17:27   ` Andrei Borzenkov [this message]
     [not found] <1474989937-25559-1-git-send-email-sakar.arora@nxp.com>
2016-10-12 11:25 ` Bhupesh Sharma
2016-10-13  3:23   ` Andrei Borzenkov

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=c293de9b-4a67-e11f-4583-b9af0eb38ac8@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=bhupesh.sharma@nxp.com \
    --cc=grub-devel@gnu.org \
    --cc=sakar.arora@nxp.com \
    /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 NNTP newsgroup(s).