Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14fb8a76 authored by Li Yewang's avatar Li Yewang Committed by David S. Miller
Browse files

[IPV4]: Fix BUG of ip_rt_send_redirect()



Fix the redirect packet of the router if the jiffies wraparound.

Signed-off-by: default avatarLi Yewang <lyw@nanjing-fnst.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a9fc00cc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);