mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
[deliverable/linux.git] / net / mac80211 / mesh.c
index 0675a2fec6a68705d034ac7e44ab14c52b7aaa37..ae40a83675e98a9f4226e2281bc3d92c4a83ab45 100644 (file)
@@ -109,8 +109,10 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
 
        /* Disallow HT40+/- mismatch */
        if (ie->ht_operation &&
-           local->_oper_channel_type > NL80211_CHAN_HT20 &&
-           sta_channel_type > NL80211_CHAN_HT20 &&
+           (local->_oper_channel_type == NL80211_CHAN_HT40MINUS ||
+           local->_oper_channel_type == NL80211_CHAN_HT40PLUS) &&
+           (sta_channel_type == NL80211_CHAN_HT40MINUS ||
+            sta_channel_type == NL80211_CHAN_HT40PLUS) &&
            local->_oper_channel_type != sta_channel_type)
                goto mismatch;
 
@@ -441,7 +443,7 @@ static void ieee80211_mesh_path_root_timer(unsigned long data)
 
 void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh)
 {
-       if (ifmsh->mshcfg.dot11MeshHWMPRootMode)
+       if (ifmsh->mshcfg.dot11MeshHWMPRootMode > IEEE80211_ROOTMODE_ROOT)
                set_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags);
        else {
                clear_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags);
@@ -522,8 +524,7 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata,
        bool free_plinks;
 
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
-       printk(KERN_DEBUG "%s: running mesh housekeeping\n",
-              sdata->name);
+       pr_debug("%s: running mesh housekeeping\n", sdata->name);
 #endif
 
        ieee80211_sta_expire(sdata, IEEE80211_MESH_PEER_INACTIVITY_LIMIT);
@@ -540,11 +541,17 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata,
 static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata)
 {
        struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+       u32 interval;
 
        mesh_path_tx_root_frame(sdata);
+
+       if (ifmsh->mshcfg.dot11MeshHWMPRootMode == IEEE80211_PROACTIVE_RANN)
+               interval = ifmsh->mshcfg.dot11MeshHWMPRannInterval;
+       else
+               interval = ifmsh->mshcfg.dot11MeshHWMProotInterval;
+
        mod_timer(&ifmsh->mesh_path_root_timer,
-                 round_jiffies(TU_TO_EXP_TIME(
-                                 ifmsh->mshcfg.dot11MeshHWMPRannInterval)));
+                 round_jiffies(TU_TO_EXP_TIME(interval)));
 }
 
 #ifdef CONFIG_PM
This page took 0.028973 seconds and 5 git commands to generate.