Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1779584imm; Thu, 27 Sep 2018 02:20:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV63xtaPBwwxa3MF5A893aWuVZtevIvNyR+60FTAvWfRNtNKidOtq7oBor78T4YTuVCO7k9ZO X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr10151735plb.58.1538040010574; Thu, 27 Sep 2018 02:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538040010; cv=none; d=google.com; s=arc-20160816; b=xTmNs1YE898OEF31GpXH4Zw/qRsXZJOWn2MIv14tuFbYKgC2shbpcoUJUeiGkv3DqP hHxu1Uya8O/sly7O4exG4lZYWc2qG0XjBIzOv4/K3JdTymZTWlQpjx1AgmHDkfcRCZ82 /Hd4R7TBwEMPL1laGCxACcYRjGiFC13TJfbuRAEBgbAQBGgJzC7aXSJ9bbO5eotE4g/3 1tf9f+zL5H3k73kzkp8BXQJGfns352FCS14SvBqeeMKNJDQn2pmbk0P1HteXacc5vxIy rjUABUzZdvf3OrLK0AcE6wMVyaK7N5p0hL14bxKPc0HxX7r37pJ3F0Ldp0IaKP/kuAHT +FUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=8yW/CMMI4L/p4yPsbwGLDvBKTCXCOyxm+snLlv+NAIQ=; b=esjbh9TfRLzGEuASkxMamVwTzE8z5h8SRKMzEHQzVzRxsl/tyls335JyKethDH4fCb jf4nVGJh63/8otNtm9Kl797iNoABD42sN0ppvt6A/0t9h6jjmK2FTedBxETvfsCFz45w qGYf3UkyQ885ZP1Gv/NKY1lGe9Wh5JoiXnIn19V/y8jhHyTGlqYRUVQWo/fLryB4yH2q 7/eke85+3LJPvSZ2M+Exv9ZOPYGCZBy4JVd92j+0qu3gF6fUWVjmGLsu67VWvEnJeQp1 +7nm+QM01K7VB+QLrWDpRtvSWKvarYmRcSO0soX3MYCXNzAS5jYxzG1LFPEMUbnVkBer Q3xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14-v6si1447478pgh.22.2018.09.27.02.19.55; Thu, 27 Sep 2018 02:20:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728318AbeI0Pg1 (ORCPT + 99 others); Thu, 27 Sep 2018 11:36:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56182 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727216AbeI0Pg0 (ORCPT ); Thu, 27 Sep 2018 11:36:26 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AC01A110D; Thu, 27 Sep 2018 09:19:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasily Khoruzhick , "David S. Miller" Subject: [PATCH 4.14 08/64] neighbour: confirm neigh entries when ARP packet is received Date: Thu, 27 Sep 2018 11:03:25 +0200 Message-Id: <20180927090250.864160291@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090249.801943776@linuxfoundation.org> References: <20180927090249.801943776@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vasily Khoruzhick [ Upstream commit f0e0d04413fcce9bc76388839099aee93cd0d33b ] 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 sense to confirm it when ARP packet is received. Fixes: 77d7123342dc ("neighbour: update neigh timestamps iff update is effective") Signed-off-by: Vasily Khoruzhick Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/neighbour.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1174,6 +1174,12 @@ int neigh_update(struct neighbour *neigh lladdr = neigh->ha; } + /* Update confirmed timestamp for neighbour entry after we + * received ARP packet even if it doesn't change IP to MAC binding. + */ + 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. */ @@ -1195,15 +1201,12 @@ int neigh_update(struct neighbour *neigh } } - /* Update timestamps only once we know we will make a change to the + /* Update timestamp only once we know we will make a change to the * 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);