summaryrefslogtreecommitdiff
path: root/net/batman-adv/bridge_loop_avoidance.h
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@open-mesh.com>2016-11-24 18:11:01 +0300
committerSimon Wunderlich <sw@simonwunderlich.de>2017-01-26 10:34:18 +0300
commitd3e9768ab97fbbff43d9face2711692206a576a9 (patch)
tree553f935afc2de9a0ae226e77744514f800f02770 /net/batman-adv/bridge_loop_avoidance.h
parent32bcad4b7f33f79847e6d4757e9cf26c6980bac6 (diff)
downloadlinux-d3e9768ab97fbbff43d9face2711692206a576a9.tar.xz
batman-adv: don't add loop detect macs to TT
The bridge loop avoidance (BLA) feature of batman-adv sends packets to probe for Mesh/LAN packet loops. Those packets are not sent by real clients and should therefore not be added to the translation table (TT). Signed-off-by: Simon Wunderlich <simon.wunderlich@open-mesh.com>
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.h')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h
index 1ae93e46fb98..2827cd3c13d2 100644
--- a/net/batman-adv/bridge_loop_avoidance.h
+++ b/net/batman-adv/bridge_loop_avoidance.h
@@ -20,6 +20,8 @@
#include "main.h"
+#include <linux/compiler.h>
+#include <linux/stddef.h>
#include <linux/types.h>
struct net_device;
@@ -27,6 +29,22 @@ struct netlink_callback;
struct seq_file;
struct sk_buff;
+/**
+ * batadv_bla_is_loopdetect_mac - check if the mac address is from a loop detect
+ * frame sent by bridge loop avoidance
+ * @mac: mac address to check
+ *
+ * Return: true if the it looks like a loop detect frame
+ * (mac starts with BA:BE), false otherwise
+ */
+static inline bool batadv_bla_is_loopdetect_mac(const uint8_t *mac)
+{
+ if (mac[0] == 0xba && mac[1] == 0xbe)
+ return true;
+
+ return false;
+}
+
#ifdef CONFIG_BATMAN_ADV_BLA
bool batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
unsigned short vid, bool is_bcast);