Skip to content

Commit 88e48d7

Browse files
author
Antonio Quartulli
committed
batman-adv: make DAT drop ARP requests targeting local clients
In the outgoing ARP request snooping routine in DAT, ARP Request sent by local clients which are supposed to be replied by other local clients can be silently dropped. The destination host will reply by itself through the LAN and therefore there is no need to involve DAT. Reported-by: Carlos Quijano <carlos@crqgestion.es> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Tested-by: Carlos Quijano <carlos@crqgestion.es> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
1 parent 7da1997 commit 88e48d7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,19 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
837837

838838
dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst);
839839
if (dat_entry) {
840+
/* If the ARP request is destined for a local client the local
841+
* client will answer itself. DAT would only generate a
842+
* duplicate packet.
843+
*
844+
* Moreover, if the soft-interface is enslaved into a bridge, an
845+
* additional DAT answer may trigger kernel warnings about
846+
* a packet coming from the wrong port.
847+
*/
848+
if (batadv_is_my_client(bat_priv, dat_entry->mac_addr)) {
849+
ret = true;
850+
goto out;
851+
}
852+
840853
skb_new = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_src,
841854
bat_priv->soft_iface, ip_dst, hw_src,
842855
dat_entry->mac_addr, hw_src);

0 commit comments

Comments
 (0)