netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] neigh: fix ARP retransmit timer guard
@ 2020-05-28  7:15 Hangbin Liu
  2020-05-29 23:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Hangbin Liu @ 2020-05-28  7:15 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Hangbin Liu, Jianwen Ji

In commit 19e16d220f0a ("neigh: support smaller retrans_time settting")
we add more accurate control for ARP and NS. But for ARP I forgot to
update the latest guard in neigh_timer_handler(), then the next
retransmit would be reset to jiffies + HZ/2 if we set the retrans_time
less than 500ms. Fix it by setting the time_before() check to HZ/100.

IPv6 does not have this issue.

Reported-by: Jianwen Ji <jiji@redhat.com>
Fixes: 19e16d220f0a ("neigh: support smaller retrans_time settting")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/core/neighbour.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 116139233d57..dbe0c6ead773 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1082,8 +1082,8 @@ static void neigh_timer_handler(struct timer_list *t)
 	}
 
 	if (neigh->nud_state & NUD_IN_TIMER) {
-		if (time_before(next, jiffies + HZ/2))
-			next = jiffies + HZ/2;
+		if (time_before(next, jiffies + HZ/100))
+			next = jiffies + HZ/100;
 		if (!mod_timer(&neigh->timer, next))
 			neigh_hold(neigh);
 	}
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] neigh: fix ARP retransmit timer guard
  2020-05-28  7:15 [PATCH net] neigh: fix ARP retransmit timer guard Hangbin Liu
@ 2020-05-29 23:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-29 23:57 UTC (permalink / raw)
  To: liuhangbin; +Cc: netdev, jiji

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Thu, 28 May 2020 15:15:13 +0800

> In commit 19e16d220f0a ("neigh: support smaller retrans_time settting")
> we add more accurate control for ARP and NS. But for ARP I forgot to
> update the latest guard in neigh_timer_handler(), then the next
> retransmit would be reset to jiffies + HZ/2 if we set the retrans_time
> less than 500ms. Fix it by setting the time_before() check to HZ/100.
> 
> IPv6 does not have this issue.
> 
> Reported-by: Jianwen Ji <jiji@redhat.com>
> Fixes: 19e16d220f0a ("neigh: support smaller retrans_time settting")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-29 23:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28  7:15 [PATCH net] neigh: fix ARP retransmit timer guard Hangbin Liu
2020-05-29 23:57 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).