From patchwork Thu Feb 14 15:52:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 17828 X-Patchwork-Delegate: a@unstable.cc Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id EF4E281A77; Thu, 14 Feb 2019 16:52:52 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=c0d3.blue header.i=@c0d3.blue header.b="UmLvH3xG"; dkim-atps=neutral Received-SPF: None (mailfrom) identity=mailfrom; client-ip=138.201.29.205; helo=mail.aperture-lab.de; envelope-from=linus.luessing@c0d3.blue; receiver= Received: from mail.aperture-lab.de (mail.aperture-lab.de [138.201.29.205]) by open-mesh.org (Postfix) with ESMTPS id 6C59E81A77 for ; Thu, 14 Feb 2019 16:52:51 +0100 (CET) From: =?utf-8?q?Linus_L=C3=BCssing?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c0d3.blue; s=2018; t=1550159571; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=9qQXqnV/3e25bzMIdEAHkfD00SIzGif053Ezyl6Gtos=; b=UmLvH3xG46QfNAAUEPfH45InVMwzUDLWJa5Cht08a0H3MtXxdLu1VXAYHgJ6Q06AW9mZTG sbsEp9Zv9fJpk2Cfm47yC70WEB+EDlVpP3D+OW4SvdMlQr2pi2QHrNWlMxHkjWbyLxTxyi pCMSMhutgFSx/OsUmUkDBiYb2HPZYOISXXMclgtPGV9T47akYPaT48LOhZaziIQeIEderh 99bGiiEolFbOhSgTHX8C0MRAf+q4Upxv655X12YbF5TUWR7IU9XW+wKhzsfrns0DqOsqXC YRsteq9Bda+EvAXeen9tOrrCDt0xOtYyorHvF9xTEEqKIRqwFXZC2kh82AbZGw== To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 14 Feb 2019 16:52:43 +0100 Message-Id: <20190214155243.10207-1-linus.luessing@c0d3.blue> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=c0d3.blue; s=2018; t=1550159571; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=9qQXqnV/3e25bzMIdEAHkfD00SIzGif053Ezyl6Gtos=; b=ijeAHRY80epVJJy1MY8lqZKYcqZYEUaQnAX8TV17V5LHYzYyRZxUqvtg6hKxzWCum+2Fv0 JGJpae/rJGtNYISbytU2b22kZL8o3OALC3MfnuWf29bWx1xu2naEC+sZFLNpyZ/KPIqEtm 3FKkHRz9Sbooukm5kCp+nO0Fp2AbR+hO+KYOP9UABTd5KDnPhNKzrWh2vSUFqA1zbRoiyH mxn/HE2cVik/3sJ9l4KtCMAVbVj7QNiOnJb5ep2i3oWsd6okPATBVByH/GMpm869SygjP/ 65ia+lTsMKyTd262zbN1XbwOeTocp1IA85jGJCF14m6LwlphplC/dhsp006hFA== ARC-Seal: i=1; s=2018; d=c0d3.blue; t=1550159571; a=rsa-sha256; cv=none; b=aoMves++p0/KUjkuZGQwV3XzQiQq71WLvS61vKFofEPzOeNDmLFYf+zem5w2Nyh1BiJP7P QtPv52ysoZ9e01L1LHMg8zXCpXEv6ip4Hg8SHfj8f8df8X80dw1FnggDZ/RnfyYc953hIO GZQ/NApIyQCT5NECm24Z3Pw0UJrZZyeX8PAIpMHO1aWxx5VcD+e92mGTRVQOU1fU3QNF2H nxmUp723VuAj90htB5ZRBbcvsJWzcchRgsdhMTsmxlG08MIwhgYYNRCJQ4PTJBoYv4s7eU e1UqNEyWuo2B8tuLEWkvhQ0A+3RK2H1jx8p0VYHKfu0ODcNm0JlC/+sHVB3NEQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=linus.luessing@c0d3.blue smtp.mailfrom=linus.luessing@c0d3.blue Authentication-Results: ORIGINATING; auth=pass smtp.auth=linus.luessing@c0d3.blue smtp.mailfrom=linus.luessing@c0d3.blue Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: allow updating DAT entry timeouts on incoming ARP Replies X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Cc: Daniel Ehlers Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 --- This patch was verified in VMs via gratuitous ARP Replies generated by "mausezahn", together with the "batman-adv: allow snooping gratuitous ARP Replies" patch. Before this patch, the timeout observed via "batctl dc" would continue to increase on gratuitous ARP Reply reception. After this patch, the last-seen value was reset to 0 successfully. --- 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 310a4f35..8d290da0 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -1444,7 +1444,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 @@ -1453,6 +1452,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