mac80211: expire mesh peers based on mesh configuration
authorColleen Twitty <colleen@cozybit.com>
Mon, 3 Jun 2013 16:53:40 +0000 (09:53 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 11 Jun 2013 12:16:29 +0000 (14:16 +0200)
The time it takes to see the peer link expire may differ
by a minute since sta_expire() is run once a minute as a
mesh housekeeping task.

Signed-off-by: Colleen Twitty <colleen@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/mesh.c
net/mac80211/mesh.h

index 30622101d3b540aa0c701364b3b1667673f33fbf..344a57968079f60cd803b0db2311ca897e611217 100644 (file)
@@ -1871,6 +1871,8 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
        if (_chg_mesh_attr(NL80211_MESHCONF_AWAKE_WINDOW, mask))
                conf->dot11MeshAwakeWindowDuration =
                        nconf->dot11MeshAwakeWindowDuration;
+       if (_chg_mesh_attr(NL80211_MESHCONF_PLINK_TIMEOUT, mask))
+               conf->plink_timeout = nconf->plink_timeout;
        ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON);
        return 0;
 }
index d5faf91632c12d494b06ac66fcf4a606bfb3b549..4ee527f7867782668bfac6b0cc7ad5919e194770 100644 (file)
@@ -575,7 +575,7 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata)
        struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
        u32 changed;
 
-       ieee80211_sta_expire(sdata, IEEE80211_MESH_PEER_INACTIVITY_LIMIT);
+       ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ);
        mesh_path_expire(sdata);
 
        changed = mesh_accept_plinks_update(sdata);
index 8b4d9a3e9eeeab516566028e70af246565e5a90c..01a28bca6e9b9fb896794ead6accf771bafded0b 100644 (file)
@@ -188,7 +188,6 @@ struct mesh_rmc {
        u32 idx_mask;
 };
 
-#define IEEE80211_MESH_PEER_INACTIVITY_LIMIT (1800 * HZ)
 #define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ)
 
 #define MESH_PATH_EXPIRE (600 * HZ)