Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp270339ybi; Wed, 29 May 2019 21:04:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwexG7WE4vP1xx8ob7t5W4/1UuVMsnWvCzqlaWg2I4SUahiTW9BIi8J1JjK0oROffEc4HeW X-Received: by 2002:aa7:9095:: with SMTP id i21mr2630pfa.119.1559189075424; Wed, 29 May 2019 21:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189075; cv=none; d=google.com; s=arc-20160816; b=GRfnxrKosPx92B/OzK4GJgroFR3zAYqmfD0YhbBQTLkePiyuaucgmuX2IUIZf6egVP bSCdmQIpzuOHrNhiRcD9tE8qML8avTr2/5uTeBePWzEmBlWnf/uL76IpSeWAGUDZuAx8 n6SVRq6/A2PcBae6a7RUNNVnwxyWQqvULpVSplJV2Wl9e1N1n3K4+fyn7EfF2R6vDcqU ZdPyJ6U+dnERBCTU1plwIR2llfPohHMkWoIrmXdDdtHv/iBWM+NJAZY4pDuMKXLlvaHp YN8dA6AotVFdSxfZFmwiJkasudBDcCdMdPOMcQOfkk6fm2xciTjKcWcl72gmTW00VUzG VXhQ== 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:dkim-signature; bh=a4JWdctrjFqccRZDpBa1QYhdY4SXog5gxc96GH2oZcY=; b=hzD1P7CBk+fZ015nB9RKG3g7TaE6bjeF3xhcN39VNQCATBcsfkzyCaIFbVAyKlqhpi ahfa+IMKJdilwMklRqp5Zw4f6mD66ELq1vqnzztBer+G6WkxfTw/hnPMm0ELUIMY3wyd um8i0fVJuhUey24qVFQprG7IP45qgQCO/Oyd/APMm3xuDFX/5Q7PRpu2MPKgQhhGmMvY jHVbea4sZ+I9Vz5DA6fg1LTmsJXkr2MGauUYSD/TrXu15j2J4wBMYuiFEN2nUPIgnBwQ KgvHom6aPKe9IfMnWGw1Xabo7E8J3xSmTPJ5t6SsR4GJXCzxBMYs7elDcJ83Vimw3sYq oUBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tZiyAVZz; 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 x19si2056487pgj.92.2019.05.29.21.04.18; Wed, 29 May 2019 21:04:35 -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; dkim=pass header.i=@kernel.org header.s=default header.b=tZiyAVZz; 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 S1733148AbfE3ECB (ORCPT + 99 others); Thu, 30 May 2019 00:02:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:49856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729885AbfE3DSF (ORCPT ); Wed, 29 May 2019 23:18:05 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F3EE24692; Thu, 30 May 2019 03:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186285; bh=MaBLhtL6E6bUVr5rhOE4B8vqyi8z5Rle9ZtDG1taMb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZiyAVZzW9KjOmeshYVcWbe4bGKXbhx1uJ5tAHcpjgX80Xze8wMWG+WrcvqSYUQba cOeCPovUkbxaRvfhmPaTcnlq4ZLOp4edDQhRJt+P3vUUDfvKd26hrpzGbvgpFp98y8 5prt2bfG6ex/XNzDF03Zzo+ySeU8ZWgIpPxKwcZM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Linus=20L=C3=BCssing?= , Antonio Quartulli , Sven Eckelmann , Simon Wunderlich , Sasha Levin Subject: [PATCH 4.19 239/276] batman-adv: allow updating DAT entry timeouts on incoming ARP Replies Date: Wed, 29 May 2019 20:06:37 -0700 Message-Id: <20190530030540.077757453@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 099e6cc1582dc2903fecb898bbeae8f7cf4262c7 ] Currently incoming ARP Replies, for example via a DHT-PUT message, do not update the timeout for an already existing DAT entry. These ARP Replies are dropped instead. This however defeats the purpose of the DHCPACK snooping, for instance. Right now, a DAT entry in the DHT will be purged every five minutes, likely leading to a mesh-wide ARP Request broadcast after this timeout. Which then recreates the entry. The idea of the DHCPACK snooping is to be able to update an entry before a timeout happens, to avoid ARP Request flooding. This patch fixes this issue by updating a DAT entry on incoming ARP Replies even if a matching DAT entry already exists. While still filtering the ARP Reply towards the soft-interface, to avoid duplicate messages on the client device side. Signed-off-by: Linus Lüssing Acked-by: Antonio Quartulli Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Sasha Levin --- net/batman-adv/distributed-arp-table.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index a60bacf7120be..2895e3b26e930 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -1394,7 +1394,6 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv, hw_src, &ip_src, hw_dst, &ip_dst, dat_entry->mac_addr, &dat_entry->ip); dropped = true; - goto out; } /* Update our internal cache with both the IP addresses the node got @@ -1403,6 +1402,9 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv, batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid); batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid); + if (dropped) + goto out; + /* If BLA is enabled, only forward ARP replies if we have claimed the * source of the ARP reply or if no one else of the same backbone has * already claimed that client. This prevents that different gateways -- 2.20.1