diff options
author | Sven Eckelmann <sven.eckelmann@gmx.de> | 2010-11-22 00:56:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-29 11:09:14 -0800 |
commit | 951c44e0dbfaa580d5b4fb13427ab93ee252636a (patch) | |
tree | 76477a2882a4d711bbb734132aaebd0623d77076 /drivers/staging/batman-adv/main.h | |
parent | 8cab2fbe6dacfdd3b122c450d2fffde6ac06a8b6 (diff) | |
download | op-kernel-dev-951c44e0dbfaa580d5b4fb13427ab93ee252636a.zip op-kernel-dev-951c44e0dbfaa580d5b4fb13427ab93ee252636a.tar.gz |
Staging: batman-adv: Use kernel functions to identify broadcasts
linux/etherdevice.h already provides functions to classify different
ethernet addresses. These inlineable functions should be used instead of
custom functions.
The check for multicast together with multicast can also be replaced
with a single test for multicast because for every ethernet address x
following is always true:
is_broadcast_ether_addr(x) => is_multicast_ether_addr(x)
or when looking more at the implementation:
(FF:FF:FF:FF:FF:FF == x) => [(01:00:00:00:00:00 & x) != 00:00:00:00:00:00]
Reported-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/main.h')
-rw-r--r-- | drivers/staging/batman-adv/main.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/batman-adv/main.h b/drivers/staging/batman-adv/main.h index 3ee1eb0..6b60c33 100644 --- a/drivers/staging/batman-adv/main.h +++ b/drivers/staging/batman-adv/main.h @@ -109,6 +109,7 @@ #include <linux/mutex.h> /* mutex */ #include <linux/module.h> /* needed by all modules */ #include <linux/netdevice.h> /* netdevice */ +#include <linux/etherdevice.h> /* ethernet address classifaction */ #include <linux/if_ether.h> /* ethernet header */ #include <linux/poll.h> /* poll_table */ #include <linux/kthread.h> /* kernel threads */ @@ -136,8 +137,6 @@ void mesh_free(struct net_device *soft_iface); void inc_module_count(void); void dec_module_count(void); int is_my_mac(uint8_t *addr); -int is_bcast(uint8_t *addr); -int is_mcast(uint8_t *addr); #ifdef CONFIG_BATMAN_ADV_DEBUG int debug_log(struct bat_priv *bat_priv, char *fmt, ...); |