diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-03-31 06:12:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:39 -0400 |
commit | 18a8365992a8041aa178ae9ad5f0d951d0457230 (patch) | |
tree | cb7a461139269feb191e5f5d03c4438cfa9335f2 /net/wireless | |
parent | 75c2148fa5330c6de741fc96e3308f57d846a6b4 (diff) |
cfg80211: introduce scan IE limit attribute
This patch introduces a new attribute for a wiphy that tells
userspace how long the information elements added to a probe
request frame can be at most. It also updates the at76 to
advertise that it cannot support that, and, for now until I
can fix that, iwlwifi too.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 1394115cde95..447fa1790b4e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -181,6 +181,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
181 | NLA_PUT_STRING(msg, NL80211_ATTR_WIPHY_NAME, wiphy_name(&dev->wiphy)); | 181 | NLA_PUT_STRING(msg, NL80211_ATTR_WIPHY_NAME, wiphy_name(&dev->wiphy)); |
182 | NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, | 182 | NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, |
183 | dev->wiphy.max_scan_ssids); | 183 | dev->wiphy.max_scan_ssids); |
184 | NLA_PUT_U16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN, | ||
185 | dev->wiphy.max_scan_ie_len); | ||
184 | 186 | ||
185 | nl_modes = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_IFTYPES); | 187 | nl_modes = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_IFTYPES); |
186 | if (!nl_modes) | 188 | if (!nl_modes) |
@@ -2528,6 +2530,11 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) | |||
2528 | else | 2530 | else |
2529 | ie_len = 0; | 2531 | ie_len = 0; |
2530 | 2532 | ||
2533 | if (ie_len > wiphy->max_scan_ie_len) { | ||
2534 | err = -EINVAL; | ||
2535 | goto out; | ||
2536 | } | ||
2537 | |||
2531 | request = kzalloc(sizeof(*request) | 2538 | request = kzalloc(sizeof(*request) |
2532 | + sizeof(*ssid) * n_ssids | 2539 | + sizeof(*ssid) * n_ssids |
2533 | + sizeof(channel) * n_channels | 2540 | + sizeof(channel) * n_channels |