mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[IPV4]: Fix BUG of ip_rt_send_redirect()
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>
This commit is contained in:
parent
a9fc00cca8
commit
14fb8a7647
1 changed files with 2 additions and 1 deletions
|
@ -1325,7 +1325,8 @@ void ip_rt_send_redirect(struct sk_buff *skb)
|
||||||
/* Check for load limit; set rate_last to the latest sent
|
/* Check for load limit; set rate_last to the latest sent
|
||||||
* redirect.
|
* redirect.
|
||||||
*/
|
*/
|
||||||
if (time_after(jiffies,
|
if (rt->u.dst.rate_tokens == 0 ||
|
||||||
|
time_after(jiffies,
|
||||||
(rt->u.dst.rate_last +
|
(rt->u.dst.rate_last +
|
||||||
(ip_rt_redirect_load << rt->u.dst.rate_tokens)))) {
|
(ip_rt_redirect_load << rt->u.dst.rate_tokens)))) {
|
||||||
icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt->rt_gateway);
|
icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt->rt_gateway);
|
||||||
|
|
Loading…
Reference in a new issue