P2P: Update peer operating channel from GO Negotiation Confirm
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 26 Aug 2013 11:16:31 +0000 (14:16 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 26 Aug 2013 11:16:31 +0000 (14:16 +0300)
If the device that sends the GO Negotiation Confirm becomes the GO, it
may change its operating channel preference between GO Negotiation
Request and Confirm messages based on the channel list received from us.
Previously, the peer operating channel preference was not updated in
such a case and this could result in the initial scans after GO
Negotiation using incorrect operating channel and as such, extra delay
in the connection process. Fix this by updating the operating channel
information from GO Negotiation Confirm in cases where the peer becomes
the GO.

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

src/p2p/p2p_go_neg.c

index 861d8fc..e2a31e4 100644 (file)
@@ -1094,6 +1094,14 @@ void p2p_process_go_neg_conf(struct p2p_data *p2p, const u8 *sa,
                p2p_parse_free(&msg);
                return;
 #endif /* CONFIG_P2P_STRICT */
+       } else if (dev->go_state == REMOTE_GO) {
+               int oper_freq = p2p_channel_to_freq(msg.operating_channel[3],
+                                                   msg.operating_channel[4]);
+               if (oper_freq != dev->oper_freq) {
+                       p2p_dbg(p2p, "Updated peer (GO) operating channel preference from %d MHz to %d MHz",
+                               dev->oper_freq, oper_freq);
+                       dev->oper_freq = oper_freq;
+               }
        }
 
        if (!msg.channel_list) {