[PATCH] nl80211: fix DFS radar event parsing

Michal Kazior michal.kazior
Fri Oct 18 10:21:21 PDT 2013


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 at tieto.com>
---
 src/drivers/driver_nl80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 80673fa..668b9b8 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -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]) {
-- 
1.8.4.rc3




More information about the Hostap mailing list