Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221964
b: refs/heads/master
c: 4d774a7
h: refs/heads/master
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed Nov 10, 2010
1 parent 7835821 commit 0350552
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f581cf21b48c305c6fbbc3db5ef905deb19131e5
refs/heads/master: 4d774a7fed886522f55119ef524cbe3c90bbdc38
15 changes: 10 additions & 5 deletions trunk/drivers/staging/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static void update_mac_addresses(struct batman_if *batman_if)
batman_if->net_dev->dev_addr, ETH_ALEN);
}

static void check_known_mac_addr(uint8_t *addr)
static void check_known_mac_addr(struct net_device *net_dev)
{
struct batman_if *batman_if;

Expand All @@ -175,11 +175,16 @@ static void check_known_mac_addr(uint8_t *addr)
(batman_if->if_status != IF_TO_BE_ACTIVATED))
continue;

if (!compare_orig(batman_if->net_dev->dev_addr, addr))
if (batman_if->net_dev == net_dev)
continue;

if (!compare_orig(batman_if->net_dev->dev_addr,
net_dev->dev_addr))
continue;

pr_warning("The newly added mac address (%pM) already exists "
"on: %s\n", addr, batman_if->net_dev->name);
"on: %s\n", net_dev->dev_addr,
batman_if->net_dev->name);
pr_warning("It is strongly recommended to keep mac addresses "
"unique to avoid problems!\n");
}
Expand Down Expand Up @@ -430,7 +435,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
atomic_set(&batman_if->refcnt, 0);
hardif_hold(batman_if);

check_known_mac_addr(batman_if->net_dev->dev_addr);
check_known_mac_addr(batman_if->net_dev);

spin_lock(&if_list_lock);
list_add_tail_rcu(&batman_if->list, &if_list);
Expand Down Expand Up @@ -515,7 +520,7 @@ static int hard_if_event(struct notifier_block *this,
goto out;
}

check_known_mac_addr(batman_if->net_dev->dev_addr);
check_known_mac_addr(batman_if->net_dev);
update_mac_addresses(batman_if);

bat_priv = netdev_priv(batman_if->soft_iface);
Expand Down

0 comments on commit 0350552

Please sign in to comment.