diff options
author | Masashi Honma <masashi.honma@gmail.com> | 2015-02-24 08:42:16 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-02-28 15:31:10 -0500 |
commit | 31f909a2c0abfc1a1a76b2981d28ac85d33210e7 (patch) | |
tree | 204d09f9f14303ca93fb38c5526185b4cbd2ee3b /net | |
parent | cd37a90b2a417e5882414e19954eeed174aa4d29 (diff) |
nl/mac80211: allow zero plink timeout to disable STA expiration
Both wpa_supplicant and mac80211 have and inactivity timer. By default
wpa_supplicant will be timed out in 5 minutes and mac80211's it is 30
minutes. If wpa_supplicant uses a longer timer than mac80211, it will
get unexpected disconnection by mac80211.
Using 0xffffffff instead as the configured value could solve this w/o
changing the code, but due to integer overflow in the expression used
this doesn't work. The expression is:
(current jiffies) > (frame Rx jiffies + NL80211_MESHCONF_PLINK_TIMEOUT * 250)
On 32bit system, the right side would overflow and be a very small
value if NL80211_MESHCONF_PLINK_TIMEOUT is sufficiently large,
causing unexpectedly early disconnections.
Instead allow disabling the inactivity timer to avoid this situation,
by passing the (previously invalid and useless) value 0.
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
[reword/rewrap commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mesh.c | 3 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 0c8b2a77d312..acf441ff9f4a 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -574,7 +574,8 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) | |||
574 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; | 574 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; |
575 | u32 changed; | 575 | u32 changed; |
576 | 576 | ||
577 | ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); | 577 | if (ifmsh->mshcfg.plink_timeout > 0) |
578 | ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); | ||
578 | mesh_path_expire(sdata); | 579 | mesh_path_expire(sdata); |
579 | 580 | ||
580 | changed = mesh_accept_plinks_update(sdata); | 581 | changed = mesh_accept_plinks_update(sdata); |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d78fd8b54515..9c6e23ede5b2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -5265,7 +5265,7 @@ do { \ | |||
5265 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshAwakeWindowDuration, | 5265 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshAwakeWindowDuration, |
5266 | 0, 65535, mask, | 5266 | 0, 65535, mask, |
5267 | NL80211_MESHCONF_AWAKE_WINDOW, nla_get_u16); | 5267 | NL80211_MESHCONF_AWAKE_WINDOW, nla_get_u16); |
5268 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, plink_timeout, 1, 0xffffffff, | 5268 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, plink_timeout, 0, 0xffffffff, |
5269 | mask, NL80211_MESHCONF_PLINK_TIMEOUT, | 5269 | mask, NL80211_MESHCONF_PLINK_TIMEOUT, |
5270 | nla_get_u32); | 5270 | nla_get_u32); |
5271 | if (mask_out) | 5271 | if (mask_out) |