Skip to content

Commit

Permalink
Staging: batman-adv: fix own mac address detection
Browse files Browse the repository at this point in the history
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: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Aug 24, 2010
1 parent b7a23bc commit 51e21ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/staging/batman-adv/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,13 @@ int choose_orig(void *data, int32_t size)
int is_my_mac(uint8_t *addr)
{
struct batman_if *batman_if;

rcu_read_lock();
list_for_each_entry_rcu(batman_if, &if_list, list) {
if ((batman_if->net_dev) &&
(compare_orig(batman_if->net_dev->dev_addr, addr))) {
if (batman_if->if_status != IF_ACTIVE)
continue;

if (compare_orig(batman_if->net_dev->dev_addr, addr)) {
rcu_read_unlock();
return 1;
}
Expand Down

0 comments on commit 51e21ae

Please sign in to comment.