]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Read reg-domain information from a specific wiphy
authorPeng Xu <pxu@codeaurora.org>
Thu, 18 Oct 2018 19:03:25 +0000 (12:03 -0700)
committerJouni Malinen <jouni@codeaurora.org>
Wed, 24 Oct 2018 15:36:34 +0000 (18:36 +0300)
If driver supports self-managed regulatory domain, read reg-domain
information for that specific wiphy interface instead the global
information which may be different which such drivers. This fixes issues
where a regulatory update with a self-managed regulatory domain driver
ended up building incorrect list of supported channels for upper layer
hostapd/wpa_supplicant operations.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/drivers/driver_nl80211_capa.c

index c751713e78eedc704430c6001daa8e4f37b48c85..7b360d209aba29882eecd05a544b1d2e8040896b 100644 (file)
@@ -1921,6 +1921,13 @@ static int nl80211_set_regulatory_flags(struct wpa_driver_nl80211_data *drv,
                return -ENOMEM;
 
        nl80211_cmd(drv, msg, 0, NL80211_CMD_GET_REG);
+       if (drv->capa.flags & WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY) {
+               if (nla_put_u32(msg, NL80211_ATTR_WIPHY, drv->wiphy_idx)) {
+                       nlmsg_free(msg);
+                       return -1;
+               }
+       }
+
        return send_and_recv_msgs(drv, msg, nl80211_get_reg, results);
 }