]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Validate p2p_oper_channel in p2p_group_add
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 26 Mar 2012 19:06:48 +0000 (22:06 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 26 Mar 2012 19:06:48 +0000 (22:06 +0300)
If the p2p_group_add command does not specify the operating channel,
make sure the operating channel set in the configuration file meets
the P2P requirements in the same way as is done with the frequency
specified as the command parameter.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/p2p_supplicant.c

index 486a551c4f025d83fb83a0379c82d2a1b71ae5ed..e7de82f6922bac04c3cf9243ee654a1211b060bb 100644 (file)
@@ -3293,6 +3293,13 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group,
 
        if (wpas_p2p_init_go_params(wpa_s, &params, freq))
                return -1;
+       if (params.freq &&
+           !p2p_supported_freq(wpa_s->global->p2p, params.freq)) {
+               wpa_printf(MSG_DEBUG, "P2P: The selected channel for GO "
+                          "(%u MHz) is not supported for P2P uses",
+                          params.freq);
+               return -1;
+       }
        p2p_go_params(wpa_s->global->p2p, &params);
        params.persistent_group = persistent_group;