Author: marek Date: 2010-08-01 16:31:54 +0200 (Sun, 01 Aug 2010) New Revision: 1752
Modified: trunk/batman-adv/main.c Log: 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
Modified: trunk/batman-adv/main.c =================================================================== --- trunk/batman-adv/main.c 2010-07-31 17:21:13 UTC (rev 1751) +++ trunk/batman-adv/main.c 2010-08-01 14:31:54 UTC (rev 1752) @@ -247,10 +247,13 @@ 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; }