diff mbox

[6/6] mac80211: init mesh timer for user authed STAs

Message ID 1362204172-28307-6-git-send-email-thomas@cozybit.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Thomas Pedersen March 2, 2013, 6:02 a.m. UTC
There is a corner case which wasn't being covered:
userspace may authenticate and allocate stations,
but still leave the peering up to the kernel.

Initialize the peering timer if the MPM is not in
userspace, in a path which is taken by both the kernel and
userspace when allocating stations.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
 net/mac80211/mesh_plink.c |    1 -
 net/mac80211/sta_info.c   |    5 +++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Johannes Berg March 4, 2013, 3:11 p.m. UTC | #1
On Fri, 2013-03-01 at 22:02 -0800, Thomas Pedersen wrote:
> There is a corner case which wasn't being covered:
> userspace may authenticate and allocate stations,
> but still leave the peering up to the kernel.
> 
> Initialize the peering timer if the MPM is not in
> userspace, in a path which is taken by both the kernel and
> userspace when allocating stations.

Shouldn't this patch go to 3.9, instead of being based on userspace MPM?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Pedersen March 4, 2013, 8:05 p.m. UTC | #2
On Mon, Mar 4, 2013 at 7:11 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Fri, 2013-03-01 at 22:02 -0800, Thomas Pedersen wrote:
>> There is a corner case which wasn't being covered:
>> userspace may authenticate and allocate stations,
>> but still leave the peering up to the kernel.
>>
>> Initialize the peering timer if the MPM is not in
>> userspace, in a path which is taken by both the kernel and
>> userspace when allocating stations.
>
> Shouldn't this patch go to 3.9, instead of being based on userspace MPM?

I doubt anyone is even exercising the above scenario, but sure, I can
resubmit for 3.9.
Thomas Pedersen March 4, 2013, 9:10 p.m. UTC | #3
On Mon, Mar 4, 2013 at 12:05 PM, Thomas Pedersen <thomas@cozybit.com> wrote:
> On Mon, Mar 4, 2013 at 7:11 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
>> On Fri, 2013-03-01 at 22:02 -0800, Thomas Pedersen wrote:
>>> There is a corner case which wasn't being covered:
>>> userspace may authenticate and allocate stations,
>>> but still leave the peering up to the kernel.
>>>
>>> Initialize the peering timer if the MPM is not in
>>> userspace, in a path which is taken by both the kernel and
>>> userspace when allocating stations.
>>
>> Shouldn't this patch go to 3.9, instead of being based on userspace MPM?
>
> I doubt anyone is even exercising the above scenario, but sure, I can
> resubmit for 3.9.

Uh instead of submitting one patch for 3.9 then another for
mac80211-next, will you just take this one for mac80211-next? AFAIK no
one is hitting this anyway.
Johannes Berg March 5, 2013, 6:55 p.m. UTC | #4
On Mon, 2013-03-04 at 13:10 -0800, Thomas Pedersen wrote:

> >> Shouldn't this patch go to 3.9, instead of being based on userspace MPM?
> >
> > I doubt anyone is even exercising the above scenario, but sure, I can
> > resubmit for 3.9.
> 
> Uh instead of submitting one patch for 3.9 then another for
> mac80211-next, will you just take this one for mac80211-next? AFAIK no
> one is hitting this anyway.

Ok.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg March 5, 2013, 6:59 p.m. UTC | #5
On Fri, 2013-03-01 at 22:02 -0800, Thomas Pedersen wrote:
> There is a corner case which wasn't being covered:
> userspace may authenticate and allocate stations,
> but still leave the peering up to the kernel.
> 
> Initialize the peering timer if the MPM is not in
> userspace, in a path which is taken by both the kernel and
> userspace when allocating stations.

Applied this one.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 635d643..bfb1720 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -420,7 +420,6 @@  __mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *hw_addr)
 		return NULL;
 
 	sta->plink_state = NL80211_PLINK_LISTEN;
-	init_timer(&sta->plink_timer);
 
 	sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);
 	sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index a79ce82..2216361 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -342,6 +342,11 @@  struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
 	INIT_WORK(&sta->drv_unblock_wk, sta_unblock);
 	INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
 	mutex_init(&sta->ampdu_mlme.mtx);
+#ifdef CONFIG_MAC80211_MESH
+	if (ieee80211_vif_is_mesh(&sdata->vif) &&
+	    !sdata->u.mesh.user_mpm)
+		init_timer(&sta->plink_timer);
+#endif
 
 	memcpy(sta->sta.addr, addr, ETH_ALEN);
 	sta->local = local;