Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1770829imm; Thu, 27 Sep 2018 02:10:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV61gJn3aeuGj6mc1nwjKwgzLhHqkLUBjPoXLfbnhyOMQnCbjzMVVQpsfxJCOrx1rOMwdW0YG X-Received: by 2002:a62:48ce:: with SMTP id q75-v6mr10520128pfi.22.1538039414403; Thu, 27 Sep 2018 02:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039414; cv=none; d=google.com; s=arc-20160816; b=nHn5HhTtr5m1mK5Ou0uWM0C++0FyVBc9RRHsFIxzDCilQy0hzMQ6JP5mc86UTGkFzc 04ih9r82ZRlfYchni5Pf2BbHW1bhO+3gWUSam7nq+9i0eNbmFE83hkeB5QGtrmesFOs8 y5vEWaIU95+uzw4Viye3RLLKZYLsvBkShflHeNT0p9qgGi7crfEpl7zAiifAXdjsS1j5 ioLL3bEQmLJ+lhqynB35R+w2Lw5ToGZMIvc+S+TpekAqfAhhflzz7yDJXKJU6Hj69T1H xVfpWkqOAuUEICPZjiIJ8WkDVK43GqCTDnRjiYA7BuJFLnenI3NrzRVZKo/Lu9Wvz++u HqvA== 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=RYPKU3n4GQBUKPbTX9Zw3AVxM023EbUDqciyL2kHgq8=; b=AihncziYcH92EzCAkcqj8eUozm7BF/JFAnN7zkidVBUoClM8bsgTo6eXgwNltMOYhQ ZNF41dvgLA1yLEweWUpxnROgpsVMbCXtGgxdbvL/9F+WSa9SPJvkPXizDXHFDrq8MyLB birM009VU4crS8xM/BivDIUHEXtZWOE8iRBLERXTwG0XnRfL5vLtL9ThFqnL8uswXsFw d3SJa/TQ3KXIcrWnyzSvnCz/PUrSAEjVEzPAj39aJExucD3VfUbH4FXFubaNCxYF5sb6 0+uJCJQMD4fFrlA8ylU9W3+vAi4P/ad2J1eh43+aMiF2Jeci/u4tzXndPLF3MJMz/P+A TzwA== 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 b137-v6si1517562pga.90.2018.09.27.02.09.59; Thu, 27 Sep 2018 02:10:14 -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 S1728203AbeI0P0Q (ORCPT + 99 others); Thu, 27 Sep 2018 11:26:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55014 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeI0P0Q (ORCPT ); Thu, 27 Sep 2018 11:26:16 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 02A8610A4; Thu, 27 Sep 2018 09:09:00 +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.18 11/88] neighbour: confirm neigh entries when ARP packet is received Date: Thu, 27 Sep 2018 11:02:52 +0200 Message-Id: <20180927090301.886411335@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@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.18-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 @@ -1179,6 +1179,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. */ @@ -1200,15 +1206,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);