• Masashi Honma's avatar
    nl/mac80211: allow zero plink timeout to disable STA expiration · 31f909a2
    Masashi Honma authored
    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: default avatarMasashi Honma <masashi.honma@gmail.com>
    [reword/rewrap commit log]
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    31f909a2
nl80211.c 338 KB