Skip to content

Commit

Permalink
[IPV4]: Fix BUG of ip_rt_send_redirect()
Browse files Browse the repository at this point in the history
Fix the redirect packet of the router if the jiffies wraparound.

Signed-off-by: Li Yewang <lyw@nanjing-fnst.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li Yewang authored and David S. Miller committed Dec 18, 2006
1 parent a9fc00c commit 14fb8a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,8 @@ void ip_rt_send_redirect(struct sk_buff *skb)
/* Check for load limit; set rate_last to the latest sent
* redirect.
*/
if (time_after(jiffies,
if (rt->u.dst.rate_tokens == 0 ||
time_after(jiffies,
(rt->u.dst.rate_last +
(ip_rt_redirect_load << rt->u.dst.rate_tokens)))) {
icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt->rt_gateway);
Expand Down

0 comments on commit 14fb8a7

Please sign in to comment.