nl80211: Read reg-domain information from a specific wiphy

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>
This commit is contained in:
Peng Xu 2018-10-18 12:03:25 -07:00 committed by Jouni Malinen
parent 8aa4d5521c
commit 224eddb03b

View 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);
}