Skip to content

Commit

Permalink
cfg80211: prohibit zero keepalive interval
Browse files Browse the repository at this point in the history
It's not useful to specify a 0 keepalive interval, this
would send too much data. Prohibit this to also avoid
device issues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Mar 6, 2013
1 parent d339d5c commit 723d568
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -7636,7 +7636,8 @@ static int nl80211_parse_wowlan_tcp(struct cfg80211_registered_device *rdev,
return -EINVAL;

if (nla_get_u32(tb[NL80211_WOWLAN_TCP_DATA_INTERVAL]) >
rdev->wiphy.wowlan.tcp->data_interval_max)
rdev->wiphy.wowlan.tcp->data_interval_max ||
nla_get_u32(tb[NL80211_WOWLAN_TCP_DATA_INTERVAL]) == 0)
return -EINVAL;

wake_size = nla_len(tb[NL80211_WOWLAN_TCP_WAKE_PAYLOAD]);
Expand Down

0 comments on commit 723d568

Please sign in to comment.