Skip to content

Commit 7e92774

Browse files
masapgregkh
authored andcommitted
mac80211: Suppress NEW_PEER_CANDIDATE event if no room
[ Upstream commit 11197d006bcfabf0173a7820a163fcaac420d10e ] Previously, kernel sends NEW_PEER_CANDIDATE event to user land even if the found peer does not have any room to accept other peer. This causes continuous connection trials. Signed-off-by: Masashi Honma <masashi.honma@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9825826 commit 7e92774

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

net/mac80211/mesh_plink.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,14 @@ mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr,
495495

496496
/* Userspace handles station allocation */
497497
if (sdata->u.mesh.user_mpm ||
498-
sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED)
499-
cfg80211_notify_new_peer_candidate(sdata->dev, addr,
500-
elems->ie_start,
501-
elems->total_len,
502-
GFP_KERNEL);
503-
else
498+
sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
499+
if (mesh_peer_accepts_plinks(elems) &&
500+
mesh_plink_availables(sdata))
501+
cfg80211_notify_new_peer_candidate(sdata->dev, addr,
502+
elems->ie_start,
503+
elems->total_len,
504+
GFP_KERNEL);
505+
} else
504506
sta = __mesh_sta_info_alloc(sdata, addr);
505507

506508
return sta;

0 commit comments

Comments
 (0)