aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSriram R <srirrama@qti.qualcomm.com>2017-11-20 12:48:41 (GMT)
committerJouni Malinen <j@w1.fi>2017-11-26 10:42:56 (GMT)
commit725a953aea6efd312148756c7c72acf63c33e724 (patch)
treee51c1f5e69569a9801d0959b9ac6b35ff23efa4f
parentc6ba02154e4867e3e8cd5f823a70d92c08394c6d (diff)
downloadhostap-725a953aea6efd312148756c7c72acf63c33e724.zip
hostap-725a953aea6efd312148756c7c72acf63c33e724.tar.gz
hostap-725a953aea6efd312148756c7c72acf63c33e724.tar.bz2
nl80211: Filter global events based on wiphy
Avoid same interface processing nl80211 events when at least one of IFIDX, WDEV, or WIPHY index attribute is available in the nl80211 event message. Previously, a same interface processes events when ifidx and wdev id attribute were not available in the nl80211 message. This is extended to check the presence of wiphy index attribute as well since some radar notifications include only WIPHY index attrbute in the nl80211 message. Signed-off-by: Sriram R <srirrama@qti.qualcomm.com>
-rw-r--r--src/drivers/driver_nl80211_event.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index e6bc254..14a6d92 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -2387,10 +2387,11 @@ int process_global_event(struct nl_msg *msg, void *arg)
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *tb[NL80211_ATTR_MAX + 1];
struct wpa_driver_nl80211_data *drv, *tmp;
- int ifidx = -1;
+ int ifidx = -1, wiphy_idx = -1, wiphy_idx_rx = -1;
struct i802_bss *bss;
u64 wdev_id = 0;
int wdev_id_set = 0;
+ int wiphy_idx_set = 0;
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
@@ -2400,13 +2401,19 @@ int process_global_event(struct nl_msg *msg, void *arg)
else if (tb[NL80211_ATTR_WDEV]) {
wdev_id = nla_get_u64(tb[NL80211_ATTR_WDEV]);
wdev_id_set = 1;
+ } else if (tb[NL80211_ATTR_WIPHY]) {
+ wiphy_idx_rx = nla_get_u32(tb[NL80211_ATTR_WIPHY]);
+ wiphy_idx_set = 1;
}
dl_list_for_each_safe(drv, tmp, &global->interfaces,
struct wpa_driver_nl80211_data, list) {
for (bss = drv->first_bss; bss; bss = bss->next) {
- if ((ifidx == -1 && !wdev_id_set) ||
+ if (wiphy_idx_set)
+ wiphy_idx = nl80211_get_wiphy_index(bss);
+ if ((ifidx == -1 && !wiphy_idx_set && !wdev_id_set) ||
ifidx == bss->ifindex ||
+ (wiphy_idx_set && wiphy_idx == wiphy_idx_rx) ||
(wdev_id_set && bss->wdev_id_set &&
wdev_id == bss->wdev_id)) {
do_process_drv_event(bss, gnlh->cmd, tb);