mac80211: init mesh timer for user authed STAs
authorThomas Pedersen <thomas@cozybit.com>
Sat, 2 Mar 2013 06:02:52 +0000 (22:02 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 Mar 2013 15:36:14 +0000 (16:36 +0100)
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>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mesh_plink.c
net/mac80211/sta_info.c

index e259951b0219ed289e9318b7db774c3acb5e7a02..937e06fe8f2ac87f0bd640e650877f097b8aa8e5 100644 (file)
@@ -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);
index 0141e4951adf7aa365254a78fcc122709081fa84..3644ad79688abb33d78d02f2ce2ac6b707a58abe 100644 (file)
@@ -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;