Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5c56814 authored by Thomas Pedersen's avatar Thomas Pedersen Committed by John W. Linville
Browse files

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: default avatarThomas Pedersen <thomas@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8ff44ef2
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -346,6 +346,15 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,


	sta = sta_info_get(sdata, addr);
	sta = sta_info_get(sdata, addr);
	if (!sta) {
	if (!sta) {
		/* Userspace handles peer allocation when security is enabled */
		if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
			cfg80211_notify_new_peer_candidate(sdata->dev, addr,
							   elems->ie_start,
							   elems->total_len,
							   GFP_ATOMIC);
			return NULL;
		}

		sta = mesh_plink_alloc(sdata, addr);
		sta = mesh_plink_alloc(sdata, addr);
		if (!sta)
		if (!sta)
			return NULL;
			return NULL;
@@ -387,15 +396,6 @@ void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata,
{
{
	struct sta_info *sta;
	struct sta_info *sta;


	/* Userspace handles peer allocation when security is enabled */
	if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
		cfg80211_notify_new_peer_candidate(sdata->dev, hw_addr,
						   elems->ie_start,
						   elems->total_len,
						   GFP_KERNEL);
		return;
	}

	rcu_read_lock();
	rcu_read_lock();
	sta = mesh_peer_init(sdata, hw_addr, elems);
	sta = mesh_peer_init(sdata, hw_addr, elems);
	if (!sta)
	if (!sta)