linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Suppress NEW_PEER_CANDIDATE event if no room
@ 2016-11-30  0:06 Masashi Honma
  2016-12-05 14:02 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Masashi Honma @ 2016-11-30  0:06 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, me, Masashi Honma

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>
---
 net/mac80211/mesh_plink.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 7fcdcf6..fcba70e5 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -505,12 +505,14 @@ mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr,
 
 	/* Userspace handles station allocation */
 	if (sdata->u.mesh.user_mpm ||
-	    sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED)
-		cfg80211_notify_new_peer_candidate(sdata->dev, addr,
-						   elems->ie_start,
-						   elems->total_len,
-						   GFP_KERNEL);
-	else
+	    sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
+		if (mesh_peer_accepts_plinks(elems) &&
+		    mesh_plink_availables(sdata))
+			cfg80211_notify_new_peer_candidate(sdata->dev, addr,
+							   elems->ie_start,
+							   elems->total_len,
+							   GFP_KERNEL);
+	} else
 		sta = __mesh_sta_info_alloc(sdata, addr);
 
 	return sta;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: Suppress NEW_PEER_CANDIDATE event if no room
  2016-11-30  0:06 [PATCH] mac80211: Suppress NEW_PEER_CANDIDATE event if no room Masashi Honma
@ 2016-12-05 14:02 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2016-12-05 14:02 UTC (permalink / raw)
  To: Masashi Honma; +Cc: linux-wireless, me

On Wed, 2016-11-30 at 09:06 +0900, Masashi Honma wrote:
> 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.

Thanks, applied.

johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-05 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30  0:06 [PATCH] mac80211: Suppress NEW_PEER_CANDIDATE event if no room Masashi Honma
2016-12-05 14:02 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).