aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2018-01-08 01:37:48 (GMT)
committerJouni Malinen <jouni@qca.qualcomm.com>2018-01-08 01:37:48 (GMT)
commitc5cc7a59acb27804d5c7698dffd0dd2bc07ac937 (patch)
treef6a69d73f0a3001eccc129096c17960cc1cc6d80
parent7b498ecafb6762fa7f0dda8db1d17f5dfbd57039 (diff)
downloadhostap-c5cc7a59acb27804d5c7698dffd0dd2bc07ac937.zip
hostap-c5cc7a59acb27804d5c7698dffd0dd2bc07ac937.tar.gz
hostap-c5cc7a59acb27804d5c7698dffd0dd2bc07ac937.tar.bz2
Report offchannel RX frame frequency to hostapd
Not all code paths for management frame RX reporting delivered the correct frequency for offchannel RX cases. This is needed mainly for Public Action frame processing in some special cases where AP is operating, but an exchange is done on a non-operational channel. For example, DPP Initiator role may need to do this. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--src/ap/drv_callbacks.c1
-rw-r--r--src/ap/hostapd.h1
-rw-r--r--src/ap/ieee802_11.c13
3 files changed, 12 insertions, 3 deletions
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index c455360..4858cd5 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -1114,6 +1114,7 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt)
}
os_memset(&fi, 0, sizeof(fi));
+ fi.freq = rx_mgmt->freq;
fi.datarate = rx_mgmt->datarate;
fi.ssi_signal = rx_mgmt->ssi_signal;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 0e35ee8..32de734 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -85,6 +85,7 @@ struct hostapd_rate_data {
};
struct hostapd_frame_info {
+ unsigned int freq;
u32 channel;
u32 datarate;
int ssi_signal; /* dBm */
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index f6cea40..27520fe 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -3604,7 +3604,8 @@ static int robust_action_frame(u8 category)
static int handle_action(struct hostapd_data *hapd,
- const struct ieee80211_mgmt *mgmt, size_t len)
+ const struct ieee80211_mgmt *mgmt, size_t len,
+ unsigned int freq)
{
struct sta_info *sta;
sta = ap_get_sta(hapd, mgmt->sa);
@@ -3713,7 +3714,7 @@ static int handle_action(struct hostapd_data *hapd,
pos = mgmt->u.action.u.vs_public_action.oui;
end = ((const u8 *) mgmt) + len;
hostapd_dpp_rx_action(hapd, mgmt->sa, pos, end - pos,
- hapd->iface->freq);
+ freq);
return 1;
}
if (len >= IEEE80211_HDRLEN + 2 &&
@@ -3812,10 +3813,16 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
struct ieee80211_mgmt *mgmt;
u16 fc, stype;
int ret = 0;
+ unsigned int freq;
if (len < 24)
return 0;
+ if (fi && fi->freq)
+ freq = fi->freq;
+ else
+ freq = hapd->iface->freq;
+
mgmt = (struct ieee80211_mgmt *) buf;
fc = le_to_host16(mgmt->frame_control);
stype = WLAN_FC_GET_STYPE(fc);
@@ -3887,7 +3894,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
break;
case WLAN_FC_STYPE_ACTION:
wpa_printf(MSG_DEBUG, "mgmt::action");
- ret = handle_action(hapd, mgmt, len);
+ ret = handle_action(hapd, mgmt, len, freq);
break;
default:
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,