net/ip: Fix limit_time calculation in freeing old fragments

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>
This commit is contained in:
Sakar Arora 2016-09-20 01:01:17 +05:30 committed by Andrei Borzenkov
parent a0bf403f66
commit e563928ba4

View file

@ -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)