Update driver country info on 'SET country <value>'

This commit is contained in:
Jouni Malinen 2011-04-15 17:00:01 +03:00 committed by Jouni Malinen
parent ca79385ab5
commit 849b5dc78b

View file

@ -2676,6 +2676,18 @@ void wpa_supplicant_deinit(struct wpa_global *global)
void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s) void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s)
{ {
if ((wpa_s->conf->changed_parameters & CFG_CHANGED_COUNTRY) &&
wpa_s->conf->country[0] && wpa_s->conf->country[1]) {
char country[3];
country[0] = wpa_s->conf->country[0];
country[1] = wpa_s->conf->country[1];
country[2] = '\0';
if (wpa_drv_set_country(wpa_s, country) < 0) {
wpa_printf(MSG_ERROR, "Failed to set country code "
"'%s'", country);
}
}
#ifdef CONFIG_WPS #ifdef CONFIG_WPS
wpas_wps_update_config(wpa_s); wpas_wps_update_config(wpa_s);
#endif /* CONFIG_WPS */ #endif /* CONFIG_WPS */