diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2012-05-03 18:06:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-15 17:27:54 -0400 |
commit | f5c5681424299add910aad86b01d6ffe7ca02c84 (patch) | |
tree | fa1189f724083e6e5585affd6fa70c3f122794d7 /net/mac80211/mesh_plink.c | |
parent | 8ff44ef26afc313af667ab48fc82b6e4d8bc525b (diff) |
mac80211: send peer candidate event for new sta only
Only send a cfg80211 new peer candidate notification if userspace has
yet to allocate this station entry.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 8cc8461b48a0..ae026acec874 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -346,6 +346,15 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, | |||
346 | 346 | ||
347 | sta = sta_info_get(sdata, addr); | 347 | sta = sta_info_get(sdata, addr); |
348 | if (!sta) { | 348 | if (!sta) { |
349 | /* Userspace handles peer allocation when security is enabled */ | ||
350 | if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) { | ||
351 | cfg80211_notify_new_peer_candidate(sdata->dev, addr, | ||
352 | elems->ie_start, | ||
353 | elems->total_len, | ||
354 | GFP_ATOMIC); | ||
355 | return NULL; | ||
356 | } | ||
357 | |||
349 | sta = mesh_plink_alloc(sdata, addr); | 358 | sta = mesh_plink_alloc(sdata, addr); |
350 | if (!sta) | 359 | if (!sta) |
351 | return NULL; | 360 | return NULL; |
@@ -387,15 +396,6 @@ void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata, | |||
387 | { | 396 | { |
388 | struct sta_info *sta; | 397 | struct sta_info *sta; |
389 | 398 | ||
390 | /* Userspace handles peer allocation when security is enabled */ | ||
391 | if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) { | ||
392 | cfg80211_notify_new_peer_candidate(sdata->dev, hw_addr, | ||
393 | elems->ie_start, | ||
394 | elems->total_len, | ||
395 | GFP_KERNEL); | ||
396 | return; | ||
397 | } | ||
398 | |||
399 | rcu_read_lock(); | 399 | rcu_read_lock(); |
400 | sta = mesh_peer_init(sdata, hw_addr, elems); | 400 | sta = mesh_peer_init(sdata, hw_addr, elems); |
401 | if (!sta) | 401 | if (!sta) |