[commits] [batman-adv] master: batman-adv: allow updating DAT entry timeouts on incoming ARP Replies (35f67560)

postmaster at open-mesh.org postmaster at open-mesh.org
Thu Mar 28 17:21:05 CET 2019


Repository : ssh://git@open-mesh.org/batman-adv

On branch  : master

>---------------------------------------------------------------

commit 35f6756007af4f48409671f406d728ff6b78f216
Author: Linus Lüssing <linus.luessing at c0d3.blue>
Date:   Thu Feb 14 16:52:43 2019 +0100

    batman-adv: allow updating DAT entry timeouts on incoming ARP Replies
    
    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 <linus.luessing at c0d3.blue>
    Acked-by: Antonio Quartulli <a at unstable.cc>
    Signed-off-by: Sven Eckelmann <sven at narfation.org>


>---------------------------------------------------------------

35f6756007af4f48409671f406d728ff6b78f216
 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 81fc63fc..b0af3a11 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -1434,7 +1434,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
@@ -1443,6 +1442,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



More information about the commits mailing list