Skip to content

Commit 099e6cc

Browse files
T-Xsimonwunderlich
authored andcommitted
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 <[email protected]> Acked-by: Antonio Quartulli <[email protected]> Signed-off-by: Sven Eckelmann <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]>
1 parent c2d8b9a commit 099e6cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/batman-adv/distributed-arp-table.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,6 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
14341434
hw_src, &ip_src, hw_dst, &ip_dst,
14351435
dat_entry->mac_addr, &dat_entry->ip);
14361436
dropped = true;
1437-
goto out;
14381437
}
14391438

14401439
/* 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,
14431442
batadv_dat_entry_add(bat_priv, ip_src, hw_src, vid);
14441443
batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, vid);
14451444

1445+
if (dropped)
1446+
goto out;
1447+
14461448
/* If BLA is enabled, only forward ARP replies if we have claimed the
14471449
* source of the ARP reply or if no one else of the same backbone has
14481450
* already claimed that client. This prevents that different gateways

0 commit comments

Comments
 (0)