diff options
author | Andreas Pape <APape@phoenixcontact.com> | 2016-09-05 13:20:25 +0200 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2017-03-22 10:30:53 +0100 |
commit | 00311de5fbf998877f2c3109688857a99f45fdd8 (patch) | |
tree | b9cfc2c80edadc5e893bb46f94eb76f9a165c1c3 /net/batman-adv/distributed-arp-table.c | |
parent | batman-adv: Omit unnecessary memset of netdev private data (diff) | |
download | linux-00311de5fbf998877f2c3109688857a99f45fdd8.tar.xz linux-00311de5fbf998877f2c3109688857a99f45fdd8.zip |
batman-adv: prevent multiple ARP replies sent by gateways if dat enabled
If dat is enabled it must be made sure that only the backbone gw which has
claimed the remote destination for the ARP request answers the ARP request
directly if the MAC address is known due to the local dat table. This
prevents multiple ARP replies in a common backbone if more than one
gateway already knows the remote mac searched for in the ARP request.
Signed-off-by: Andreas Pape <apape@phoenixcontact.com>
Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
[sven@narfation.org: fix conflicts with current version]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/distributed-arp-table.c')
-rw-r--r-- | net/batman-adv/distributed-arp-table.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 4f643fdb5bc6..28cfa53837e1 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -43,6 +43,7 @@ #include <linux/workqueue.h> #include <net/arp.h> +#include "bridge_loop_avoidance.h" #include "hard-interface.h" #include "hash.h" #include "log.h" @@ -1040,6 +1041,20 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, goto out; } + /* If BLA is enabled, only send ARP replies if we have claimed + * the destination for the ARP request or if no one else of + * the backbone gws belonging to our backbone has claimed the + * destination. + */ + if (!batadv_bla_check_claim(bat_priv, + dat_entry->mac_addr, vid)) { + batadv_dbg(BATADV_DBG_DAT, bat_priv, + "Device %pM claimed by another backbone gw. Don't send ARP reply!", + dat_entry->mac_addr); + ret = true; + goto out; + } + skb_new = batadv_dat_arp_create_reply(bat_priv, ip_dst, ip_src, dat_entry->mac_addr, hw_src, vid); |