diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2010-08-09 23:56:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-23 18:15:37 -0700 |
commit | 51e21ae3d79e608022271f91166c84bd0e9fb8b8 (patch) | |
tree | 806f4421a649898a4eb9bcec3f7f65f5b003e19d | |
parent | b7a23bce7bc9cac85eab1b958e922b2c472ab8fd (diff) | |
download | op-kernel-dev-51e21ae3d79e608022271f91166c84bd0e9fb8b8.zip op-kernel-dev-51e21ae3d79e608022271f91166c84bd0e9fb8b8.tar.gz |
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: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/batman-adv/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c index 2686019..ef7c20a 100644 --- a/drivers/staging/batman-adv/main.c +++ b/drivers/staging/batman-adv/main.c @@ -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; } |