netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] neighbour: confirm neigh entries when ARP packet is received
@ 2018-08-29  2:48 Vasily Khoruzhick
  2018-09-01 23:51 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Vasily Khoruzhick @ 2018-08-29  2:48 UTC (permalink / raw)
  To: Ihar Hrachyshka, David S. Miller, Roopa Prabhu, Alexey Dobriyan,
	Jim Westfall, Stephen Hemminger, Vasily Khoruzhick, Kees Cook,
	Wolfgang Bumiller, Eric Dumazet, netdev
  Cc: Vasily Khoruzhick

Update 'confirmed' timestamp when ARP packet is received. It shouldn't
affect locktime logic and anyway entry can be confirmed by any higher-layer
protocol. Thus it makes no sense not to confirm it when ARP packet is
received.

Fixes: 77d7123342 ("neighbour: update neigh timestamps iff update is
effective")

Signed-off-by: Vasily Khoruzhick <vasilykh@arista.com>
---
 net/core/neighbour.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index aa19d86937af..901418ef70ea 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1180,6 +1180,9 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
 		lladdr = neigh->ha;
 	}
 
+	if (new & NUD_CONNECTED)
+		neigh->confirmed = jiffies;
+
 	/* If entry was valid and address is not changed,
 	   do not change entry state, if new one is STALE.
 	 */
@@ -1205,11 +1208,8 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
 	 * neighbour entry. Otherwise we risk to move the locktime window with
 	 * noop updates and ignore relevant ARP updates.
 	 */
-	if (new != old || lladdr != neigh->ha) {
-		if (new & NUD_CONNECTED)
-			neigh->confirmed = jiffies;
+	if (new != old || lladdr != neigh->ha)
 		neigh->updated = jiffies;
-	}
 
 	if (new != old) {
 		neigh_del_timer(neigh);
-- 
2.18.0

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

end of thread, other threads:[~2018-09-04 23:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-29  2:48 [PATCH] neighbour: confirm neigh entries when ARP packet is received Vasily Khoruzhick
2018-09-01 23:51 ` David Miller
2018-09-04 18:31   ` Ihar Hrachyshka
2018-09-04 18: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).