From 56da65be88dc82bd99624747de9a4f6447547db3 Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Tue, 7 May 2013 21:06:07 +0200 Subject: [PATCH] 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 <> Signed-off-by: Antonio Quartulli --- distributed-arp-table.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/distributed-arp-table.c b/distributed-arp-table.c index 8e15d96..e1b3fe5 100644 --- a/distributed-arp-table.c +++ b/distributed-arp-table.c @@ -837,6 +837,15 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst); if (dat_entry) { + /* If the outgoing ARP request is targeting a local client, the + * packet can be silently dropped: an ARP reply will be sent by + * the client itself through the LAN + */ + if (batadv_is_my_client(bat_priv, dat_entry->mac_addr)) { + ret = true; + goto out; + } + skb_new = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_src, bat_priv->soft_iface, ip_dst, hw_src, dat_entry->mac_addr, hw_src); -- 1.8.1.5