mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-21 11:33:04 -05:00
nl82011: Make wiphy-specific country (alpha2) available in STATUS-DRIVER
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
02d53ac351
commit
fea49f8f93
@ -8688,6 +8688,8 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
|
|||||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||||
int res;
|
int res;
|
||||||
char *pos, *end;
|
char *pos, *end;
|
||||||
|
struct nl_msg *msg;
|
||||||
|
char alpha2[3] = { 0, 0, 0 };
|
||||||
|
|
||||||
pos = buf;
|
pos = buf;
|
||||||
end = buf + buflen;
|
end = buf + buflen;
|
||||||
@ -8832,6 +8834,23 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
|
|||||||
pos += res;
|
pos += res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msg = nlmsg_alloc();
|
||||||
|
if (msg &&
|
||||||
|
nl80211_cmd(drv, msg, 0, NL80211_CMD_GET_REG) &&
|
||||||
|
nla_put_u32(msg, NL80211_ATTR_WIPHY, drv->wiphy_idx) == 0) {
|
||||||
|
if (send_and_recv_msgs(drv, msg, nl80211_get_country,
|
||||||
|
alpha2) == 0 &&
|
||||||
|
alpha2[0]) {
|
||||||
|
res = os_snprintf(pos, end - pos, "country=%s\n",
|
||||||
|
alpha2);
|
||||||
|
if (os_snprintf_error(end - pos, res))
|
||||||
|
return pos - buf;
|
||||||
|
pos += res;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
nlmsg_free(msg);
|
||||||
|
}
|
||||||
|
|
||||||
return pos - buf;
|
return pos - buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user