]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Do not allow re-selection of GO channel if forced_freq in use
authorJouni Malinen <j@w1.fi>
Thu, 27 Dec 2012 06:06:55 +0000 (08:06 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 27 Dec 2012 06:06:55 +0000 (08:06 +0200)
Even if the peer does not accept the forced channel, we should not allow
the forced_freq parameter to be be overridden, i.e., such a case needs
to result in GO Negotiation failure.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/p2p/p2p_go_neg.c

index 670e4b3de67d540cc940fd0ba8a56749bb0fc722..6efefe44054ded5d9ca8de122ca439a037283844 100644 (file)
@@ -442,8 +442,15 @@ static int p2p_go_select_channel(struct p2p_data *p2p, struct p2p_device *dev,
        }
 
        if (!p2p_channels_includes(&intersection, p2p->op_reg_class,
-                                  p2p->op_channel))
+                                  p2p->op_channel)) {
+               if (dev->flags & P2P_DEV_FORCE_FREQ) {
+                       *status = P2P_SC_FAIL_NO_COMMON_CHANNELS;
+                       wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Peer does "
+                               "not support the forced channel");
+                       return -1;
+               }
                p2p_reselect_channel(p2p, &intersection);
+       }
 
        if (!p2p->ssid_set) {
                p2p_build_ssid(p2p, p2p->ssid, &p2p->ssid_len);