summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
authorMarek Lindner2011-02-18 13:28:08 +0100
committerMarek Lindner2011-03-05 12:50:14 +0100
commit39901e716275da4e831b40f9e45a1b61d6a776dc (patch)
treea7db25062f0e3df9b7f878adaeda8aadd5644181 /net/batman-adv/main.h
parentbatman-adv: Fix possible buffer overflow in softif neigh list output (diff)
downloadkernel-qcow2-linux-39901e716275da4e831b40f9e45a1b61d6a776dc.tar.gz
kernel-qcow2-linux-39901e716275da4e831b40f9e45a1b61d6a776dc.tar.xz
kernel-qcow2-linux-39901e716275da4e831b40f9e45a1b61d6a776dc.zip
batman-adv: separate ethernet comparing calls from hash functions
Note: The function compare_ether_addr() provided by the Linux kernel requires aligned memory. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r--net/batman-adv/main.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index e235d7bbe045..06b5b994cc20 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -165,4 +165,14 @@ static inline void bat_dbg(char type __always_unused,
pr_err("%s: " fmt, _netdev->name, ## arg); \
} while (0)
+/**
+ * returns 1 if they are the same ethernet addr
+ *
+ * note: can't use compare_ether_addr() as it requires aligned memory
+ */
+static inline int compare_eth(void *data1, void *data2)
+{
+ return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
+}
+
#endif /* _NET_BATMAN_ADV_MAIN_H_ */