mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
[deliverable/linux.git] / net / mac80211 / mesh.c
index 2913113c5833f220c5708af7d8686ab4196c3d50..ae40a83675e98a9f4226e2281bc3d92c4a83ab45 100644 (file)
@@ -443,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);
@@ -524,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);
@@ -542,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.026351 seconds and 5 git commands to generate.