nl80211: Fix DFS radar event parsing

Incorrect nla_get variants were used to get event type and frequency.
Kernel passes both as u32. This caused issues on tinynl/big-endian hosts
- CAC finished was treated as radar detection and frequency was 0.

Signed-hostap: Michal Kazior <michal.kazior@tieto.com>
This commit is contained in:
Michal Kazior 2013-10-22 15:50:07 +03:00 committed by Jouni Malinen
parent 2b72df6374
commit cd3b0700df

View file

@ -2510,8 +2510,8 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv,
return;
os_memset(&data, 0, sizeof(data));
data.dfs_event.freq = nla_get_u16(tb[NL80211_ATTR_WIPHY_FREQ]);
event_type = nla_get_u8(tb[NL80211_ATTR_RADAR_EVENT]);
data.dfs_event.freq = nla_get_u32(tb[NL80211_ATTR_WIPHY_FREQ]);
event_type = nla_get_u32(tb[NL80211_ATTR_RADAR_EVENT]);
/* Check HT params */
if (tb[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {