Commit da6185d8743704bf7647c0aedaf8c7879d8f3cab
Committed by
David S. Miller
1 parent
800d55f146
Exists in
master
and in
39 other branches
gre: used time_before for comparing jiffies
The functions time_before is more robust for comparing jiffies against other values. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
net/ipv4/ip_gre.c
... | ... | @@ -491,7 +491,7 @@ |
491 | 491 | if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) |
492 | 492 | goto out; |
493 | 493 | |
494 | - if (jiffies - t->err_time < IPTUNNEL_ERR_TIMEO) | |
494 | + if (time_before(jiffies, t->err_time + IPTUNNEL_ERR_TIMEO)) | |
495 | 495 | t->err_count++; |
496 | 496 | else |
497 | 497 | t->err_count = 1; |
... | ... | @@ -803,7 +803,8 @@ |
803 | 803 | #endif |
804 | 804 | |
805 | 805 | if (tunnel->err_count > 0) { |
806 | - if (jiffies - tunnel->err_time < IPTUNNEL_ERR_TIMEO) { | |
806 | + if (time_before(jiffies, | |
807 | + tunnel->err_time + IPTUNNEL_ERR_TIMEO)) { | |
807 | 808 | tunnel->err_count--; |
808 | 809 | |
809 | 810 | dst_link_failure(skb); |