Commit 51e21ae3 authored by Marek Lindner's avatar Marek Lindner Committed by Greg Kroah-Hartman

Staging: batman-adv: fix own mac address detection

Earlier batman-adv versions would only create a batman_if struct after
a corresponding interface had been activated by a user. Now each
existing system interface has a batman_if struct and has to be checked
by verifying the IF_ACTIVE flag.
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b7a23bce
...@@ -250,10 +250,13 @@ int choose_orig(void *data, int32_t size) ...@@ -250,10 +250,13 @@ int choose_orig(void *data, int32_t size)
int is_my_mac(uint8_t *addr) int is_my_mac(uint8_t *addr)
{ {
struct batman_if *batman_if; struct batman_if *batman_if;
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(batman_if, &if_list, list) { list_for_each_entry_rcu(batman_if, &if_list, list) {
if ((batman_if->net_dev) && if (batman_if->if_status != IF_ACTIVE)
(compare_orig(batman_if->net_dev->dev_addr, addr))) { continue;
if (compare_orig(batman_if->net_dev->dev_addr, addr)) {
rcu_read_unlock(); rcu_read_unlock();
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment