summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bridge_loop_avoidance.h
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@c0d3.blue>2020-09-15 09:54:09 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2020-09-15 10:05:24 +0200
commit74c09b7275126da1b642b90c9cdc3ae8b729ad4b (patch)
tree2f149ee055bbff777843d8890bb0e467f6986d34 /net/batman-adv/bridge_loop_avoidance.h
parent3236d215ad38a3f5372e65cd1e0a52cf93d3c6a2 (diff)
downloadlinux-74c09b7275126da1b642b90c9cdc3ae8b729ad4b.tar.gz
linux-74c09b7275126da1b642b90c9cdc3ae8b729ad4b.tar.bz2
linux-74c09b7275126da1b642b90c9cdc3ae8b729ad4b.zip
batman-adv: mcast: fix duplicate mcast packets in BLA backbone from mesh
Scenario: * Multicast frame send from mesh to a BLA backbone (multiple nodes with their bat0 bridged together, with BLA enabled) Issue: * BLA backbone nodes receive the frame multiple times on bat0, once from mesh->bat0 and once from each backbone_gw from LAN For unicast, a node will send only to the best backbone gateway according to the TQ. However for multicast we currently cannot determine if multiple destination nodes share the same backbone if they don't share the same backbone with us. So we need to keep sending the unicasts to all backbone gateways and let the backbone gateways decide which one will forward the frame. We can use the CLAIM mechanism to make this decision. One catch: The batman-adv gateway feature for DHCP packets potentially sends multicast packets in the same batman-adv unicast header as the multicast optimizations code. And we are not allowed to drop those even if we did not claim the source address of the sender, as for such packets there is only this one multicast-in-unicast packet. How can we distinguish the two cases? The gateway feature uses a batman-adv unicast 4 address header. While the multicast-to-unicasts feature uses a simple, 3 address batman-adv unicast header. So let's use this to distinguish. Fixes: fe2da6ff27c7 ("batman-adv: check incoming packet type for bla") Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.h')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h
index 41edb2c4a327..a81c41b636f9 100644
--- a/net/batman-adv/bridge_loop_avoidance.h
+++ b/net/batman-adv/bridge_loop_avoidance.h
@@ -35,7 +35,7 @@ static inline bool batadv_bla_is_loopdetect_mac(const uint8_t *mac)
#ifdef CONFIG_BATMAN_ADV_BLA
bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
- unsigned short vid, bool is_bcast);
+ unsigned short vid, int packet_type);
bool batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
unsigned short vid);
bool batadv_bla_is_backbone_gw(struct sk_buff *skb,
@@ -66,7 +66,7 @@ bool batadv_bla_check_claim(struct batadv_priv *bat_priv, u8 *addr,
static inline bool batadv_bla_rx(struct batadv_priv *bat_priv,
struct sk_buff *skb, unsigned short vid,
- bool is_bcast)
+ int packet_type)
{
return false;
}