[PATCH] Add 'country CC' command to set regulatory domain

Jouni Malinen j
Fri Apr 15 07:01:12 PDT 2011

On Thu, Apr 14, 2011 at 02:34:52PM -0700, Dmitry Shmidt wrote:

> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> @@ -3290,6 +3290,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
> +	} else if (os_strncmp(buf, "COUNTRY ", 8) == 0) {
> +		if (wpa_drv_set_country(wpa_s, buf + 8))
> +			reply_len = -1;

This does not update the internal country code which is needed, e.g.,
for P2P. In addition, there is already a mechanism for updating that
through control interface: "SET country <country code>". That does not
currently call wpa_drv_set_country(), but the proper way of adding this
functionality is to add this into wpa_supplicant_update_config() instead
of introducing an alternative control interface command for the exact
same purpose. Please see whether this meets your needs:

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list