Skip to content

Commit

Permalink
avoided invalid memory access in RT{USE,REUSE,RELEASE} when 'time_sec…
Browse files Browse the repository at this point in the history
…ond'

is rewinded.
(KAME PR 439)
  • Loading branch information
jinmei committed Aug 23, 2002
1 parent 4c2449b commit 353dac1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions freebsd4/sys/net/route.h
Expand Up @@ -330,7 +330,7 @@ struct rttimer_queue {
(rt)->rt_use++; \
(rt)->rt_lastreftime = time_second; \
i = ((rt)->rt_lastreftime - (rt)->rt_createtime) / 300; \
if (i > 12) \
if (i < 0 || i > 12) \
i = 12; \
(rt)->rt_usehist[i]++; \
} while (0)
Expand All @@ -339,7 +339,7 @@ struct rttimer_queue {
do { \
int i; \
i = (time_second - (rt)->rt_createtime) / 300; \
if (i > 12) \
if (i < 0 || i > 12) \
i = 12; \
(rt)->rt_reusehist[i]++; \
} while (0)
Expand All @@ -348,7 +348,7 @@ struct rttimer_queue {
do { \
int i; \
i = (time_second - (rt)->rt_createtime) / 300; \
if (i > 12) \
if (i < 0 || i > 12) \
i = 12; \
(rt)->rt_releasehist[i]++; \
} while (0)
Expand Down

0 comments on commit 353dac1

Please sign in to comment.