Skip to contentSkip to conversation

net/ip: Fix limit_time calculation in freeing old fragments

PATCH Bhupesh Sharma 2 participants 2 messages Oct 12, 2016 – Oct 13, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Grub maintainers,

Ping.

Quoted 38 lines

-----Original Message-----
From: Sakar Arora [mailto:[email protected]]
Sent: Tuesday, September 27, 2016 8:56 PM
To: [email protected]
Cc: Bhupesh Sharma <[email protected]>; Sakar Arora <[email protected]>
Subject: [PATCH] net/ip: Fix limit_time calculation in freeing old fragments

From: Sakar Arora <[email protected]>

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.

---
 grub-core/net/ip.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
grub-core/net/ip.c index renamed from grub-core/net/ip.c +0 -0

8c56baa..4dae207 100644

grub-core/net/ip.c +3 -2
@@ -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)
--
Quoted 1 line

1.9.1

Regards,
Bhupesh

#2 lore raw

12.10.2016 14:25, Bhupesh Sharma пишет:

Quoted 13 lines

Hi Grub maintainers,

Ping.

Quoted 9 lines

-----Original Message-----
From: Sakar Arora [mailto:[email protected]]
Sent: Tuesday, September 27, 2016 8:56 PM
To: [email protected]
Cc: Bhupesh Sharma <[email protected]>; Sakar Arora <[email protected]>
Subject: [PATCH] net/ip: Fix limit_time calculation in freeing old fragments

This message apparently was never delivered to list. Could you please resend patch so it can be applied (e.g. as attachment)? Thank you.

Quoted 39 lines
Quoted 29 lines

From: Sakar Arora <[email protected]>

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.

---
 grub-core/net/ip.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
grub-core/net/ip.c index renamed from grub-core/net/ip.c +0 -0

8c56baa..4dae207 100644

grub-core/net/ip.c +3 -2
@@ -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)
--
Quoted 1 line

1.9.1

Regards,
Bhupesh

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel